directoryExists
Definition
-- @/=[C]:-1
function directoryExists(...)
Callers
@/lua/ge/extensions/editor/materialEditor.lua
lastPath = levelPath
lastCreateMaterialPath = (FS:directoryExists(levelPath .. "art/") and (levelPath .. "art/") or levelPath)
@/lua/ge/extensions/gameplay/crawl/saveSystem.lua
-- Ensure the crawl trails save directory exists
if not FS:directoryExists(playerSavePathFreeroam) then
FS:directoryCreate(playerSavePathFreeroam)
@/lua/ge/extensions/editor/dragRaceEditor/dragSettings.lua
-- Check if the path exists first
local pathExists = FS:directoryExists(dragStripRacePath)
log('D', 'drag_race_editor', 'dragStripRace path exists: ' .. tostring(pathExists))
-- Check if the path exists first
local pathExistsAPM = FS:directoryExists(dragStripAPMPath)
log('D', 'drag_race_editor', 'dragStripAPM path exists: ' .. tostring(pathExistsAPM))
@/lua/ge/extensions/editor/gen/exp_meshexplorer.lua
-- read favorites
if not FS:directoryExists('/save/exp') then
U.path2disk({'save','exp'})
--[[
if not FS:directoryExists('/save/exp') then
U.path2disk({'save','exp'})
@/lua/ge/extensions/freeroam/freeroamConfigurator.lua
else
if not FS:directoryExists(file) then
return false
@/lua/ge/extensions/career/modules/partInventory.lua
local vehicleDir = string.format("/vehicles/%s/", vehicleModel)
if FS:directoryExists(vehicleDir) then
local vehicleFolders = {vehicleDir, "/vehicles/common/"}
@/lua/ge/extensions/scenario/quickRaceLoader.lua
local function getLevelList()
if not FS:directoryExists('levels/') then
return {}
@/lua/ge/extensions/editor/api/material.lua
local directory,_,_ = path.split(materialFilename)
if FS:directoryExists(directory) == false then
log('E', logTag, "Given directory '" .. directory .."' does not exist!")
@/lua/ge/extensions/core/loadMapCmd.lua
end
if not FS:directoryExists(args.mapName) and not FS:fileExists(args.mapName) then
errorMsg("changeMap","map not found, you may need to add a mod")
@/lua/ge/ge_utils.lua
for _,v in pairs(files) do
if FS:directoryExists(v) and not FS:fileExists(v) then
table.insert(dirs, v)
@/lua/ge/extensions/gameplay/rally/notebook/path.lua
absPath = absPath..dir..'/'
if not FS:directoryExists(absPath) then
FS:directoryCreate(absPath)
@/lua/ge/extensions/core/replay.lua
if not FS:directoryExists(finalPath) then FS:directoryCreate(finalPath) end
local dir, fn, ext = path.split(replayFileName)
if not FS:directoryExists(missionReplaysPath) then FS:directoryCreate(missionReplaysPath) end
@/lua/ge/extensions/scenario/scenariosLoader.lua
scenarioData.mission = '/levels/'..scenarioData.levelName..'/'
if not FS:directoryExists(scenarioData.mission) then log('E', logTag, scenarioData.levelName.." scenario file not found") end
end
@/lua/ge/extensions/editor/sceneTree.lua
local fileExtensions = {{"Prefab Files (JSON)",".prefab.json"}}
local defaultPath = FS:directoryExists(prefabSaveFolder) and prefabSaveFolder or "/"
extensions.editor_fileDialog.saveFile(saveFileDialogCallback, fileExtensions, false, defaultPath)
local fileExtensions = {{"Prefab Files (JSON)",".prefab.json"}}
local defaultPath = FS:directoryExists(prefabSaveFolder) and prefabSaveFolder or "/"
extensions.editor_fileDialog.saveFile(saveFileDialogCallback, fileExtensions, false, defaultPath)
{{"Prefab Files (JSON)",".prefab.json"}}, false,
FS:directoryExists(prefabSaveFolder) and prefabSaveFolder or "/")
imgui.EndPopup()
{{"Prefab Files (JSON)",".prefab.json"}}, false,
FS:directoryExists(prefabSaveFolder) and prefabSaveFolder or "/")
end
@/lua/ge/extensions/core/modmanager.lua
if filename:find('/unpacked/') and filename:endswith('/') then
if FS:directoryExists(filename.."levels/") then
filesInZIP[#filesInZIP+1] = "/levels/" --dirty hack to refresh level list
end
if FS:directoryExists(filename.."vehicles/") then
filesInZIP[#filesInZIP+1] = "/vehicles/foo/bar.jbeam" --dirty hack to refresh veh list
-- mount only zip files and unpacked zip folders
if string.endswith(filename, '.zip') or FS:directoryExists(filename) then
-- check for unpacked mods
if FS:directoryExists(filename) then filename=filename.."/" end
for k,v in pairs(mods) do
if not FS:fileExists(v.fullpath) and not FS:directoryExists(v.fullpath) then
mods[v.modname] = nil
end
if not FS:fileExists(filename) and not FS:directoryExists(filename) then
return true
log('D', 'packMod', 'Packing : ' .. tostring(dirPath))
if not FS:directoryExists(dirPath) then
log('E', 'packMod', 'path is not a folder path='..dumps(dirPath))
@/lua/ge/extensions/editor/gen/utils.lua
s = s..step..'/'
if not FS:directoryExists(s) then
if FS:directoryCreate(s, true) ~= 0 then
@/lua/ge/extensions/util/nodeBeamExport.lua
local function ensureDir(dir)
if not FS:directoryExists(dir) then
FS:directoryCreate(dir)
if not FS:directoryExists(dir) then
FS:directoryCreate(dir)
@/lua/ge/screenshot.lua
local screenPath = screenshotPath .. tostring(getScreenShotFolderString())
if not FS:directoryExists(screenPath) then
FS:directoryCreate(screenPath)
local path = string.format("screenshots/%s", screenshotFolderString)
if not FS:directoryExists(path) then FS:directoryCreate(path) end
local screenshotDateTimeString = getScreenShotDateTimeString()
@/lua/ge/extensions/editor/crawlEditor.lua
local missionsPath = "/gameplay/missions/" .. currentLevel .. "/crawl/"
if FS:directoryExists(missionsPath) then
local missionDirs = FS:findFiles(missionsPath, "*", 0, false, true)
local missionsPath = "/gameplay/missions/" .. currentLevel .. "/crawl/"
if not FS:directoryExists(missionsPath) then
return missions
local missionsPath = "/gameplay/missions/" .. currentLevel .. "/crawl/"
if not FS:directoryExists(missionsPath) then
FS:directoryCreate(missionsPath)
local missionDir = missionsPath .. missionName .. "/"
if not FS:directoryExists(missionDir) then
FS:directoryCreate(missionDir)
local levelCrawlDir = "/levels/" .. currentLevel .. "/crawls/"
if not FS:directoryExists(levelCrawlDir) then
FS:directoryCreate(levelCrawlDir)
@/lua/ge/extensions/util/compileMeshes.lua
log('I', 'work', '*** Using cache folder: ' .. tostring(cacheDir))
if not FS:directoryExists(cacheDir) then
FS:directoryCreate(cacheDir)
@/lua/ge/server/server.lua
-- if the scenetree folder exists, try to load it
if FS:directoryExists(levelDir .. 'main/') then
LoadingManager:loadLevelJsonObjects(levelDir .. 'main/', ldgCtx)
@/lua/ge/extensions/editor/rallyEditor/pacenotes/customForm.lua
local dir = pacenote:customAudioFileDir()
if dir and FS:directoryExists(dir) then
else
@/lua/ge/extensions/util/terrainGenerator.lua
if not string.endswith(self.userDir, '/') then self.userDir = self.userDir..'/' end
if FS:directoryExists(self.userDir) then
local heightMapFiles = FS:findFiles(self.userDir, '*heightMap.png', -1, false, true)
@/lua/ge/extensions/telemetry/core.lua
local function _writeEventsToFile()
if not FS:directoryExists("telemetry") then
FS:directoryCreate("telemetry")
@/lua/ge/extensions/campaign/campaignsLoader.lua
local function getCampaignFilenames()
if not FS:directoryExists('/campaigns/') then
return {}
-- Make sure save directory for the campaigns exists
if not FS:directoryExists("saves/campaigns/") then FS:directoryCreate("saves/campaigns/") end
@/lua/ge/extensions/career/saveSystem.lua
for i = 1, tableSize(folders) do
if FS:directoryExists(folders[i]) then
if not renameFolderRec(folders[i], newName, oldNameLength) then
local function renameSaveSlot(slotName, newName)
if not isLegalDirectoryName(slotName) or not FS:directoryExists(saveRoot .. slotName)
or FS:directoryExists(saveRoot .. newName) then
if not isLegalDirectoryName(slotName) or not FS:directoryExists(saveRoot .. slotName)
or FS:directoryExists(saveRoot .. newName) then
return false
@/lua/ge/extensions/editor/mainMenu.lua
for _, modPath in ipairs(unpackedModsList) do
if FS:directoryExists(modPath.."/levels/"..levelName) and not FS:fileExists(modPath.."/levels/"..levelName) then
isModLevel = true
@/lua/ge/extensions/core/vehicles.lua
local dir = FS:directoryExists('vehicles')
if not dir then
local dir = FS:directoryExists('vehicles')
if not dir then
@/lua/ge/extensions/editor/assetBrowser.lua
local newSceneTreeEntry = '/levels/' .. levelName .. '/main/'
if FS:directoryExists(newSceneTreeEntry) then
skipFile = true
local path = var.newFolderParentDir.path .. name
if not FS:directoryExists(path) then
if FS:directoryCreate(path, true) == 0 then
elseif var.confirmationState == var.confirmationState_enum.deleteCache then
if (FS:directoryExists("/temp/assetBrowser/")) then
editor.logInfo(logTag .. "Removed thumbnail cache folder.")
@/lua/ge/extensions/editor/fileDialog.lua
local newPath = ffi.string(pathPointer)
if FS:directoryExists(newPath) then
refreshCache(newPath)
end
if FS:directoryExists(currentPath .. dirName) then
editor.logWarn("Directory does exist already.")
FS:directoryCreate(newPath)
if FS:directoryExists(newPath) then
refreshCache(newPath)
@/lua/ge/extensions/editor/crawlEditor/missionPortTool.lua
local function portMission(missionDir, targetLevel)
if not missionDir or not FS:directoryExists(missionDir) then
log('E', logTag,"Mission directory does not exist: " .. tostring(missionDir))
if not FS:directoryExists(missionsPath) then
log('W', logTag, "Missions directory does not exist: " .. missionsPath)
if FS:directoryExists(missionsPath) then
local missionDirs = FS:findFiles(missionsPath, "*", 0, false, true)
@/lua/ge/main.lua
-- put the mods folder in clear view, so users don't put stuff in the wrong place
if not FS:directoryExists("mods") then FS:directoryCreate("mods") end
if not FS:directoryExists("trackEditor") or not string.startswith(FS:getFileRealPath("trackEditor"), FS:getUserPath()) then FS:directoryCreate("trackEditor") end
end
-- make sure some important paths exist
if not FS:directoryExists("settings/") then FS:directoryCreate("settings/") end
if not FS:directoryExists("screenshots/") then FS:directoryCreate("screenshots/") end
if not FS:directoryExists("settings/") then FS:directoryCreate("settings/") end
if not FS:directoryExists("screenshots/") then FS:directoryCreate("screenshots/") end
@/lua/ge/extensions/core/levels.lua
-- check if its a valid folder really
if FS:fileExists(d) or not FS:directoryExists(d) or d == "/levels/mod_info" then
goto continue
local oldMainFile = path.getPathLevelMain(l.levelName)
if FS:directoryExists(newSceneTreeEntry) then
l.fullfilename = newSceneTreeEntry
local levels = {}
if not FS:directoryExists('/levels/') then
log('E', '', 'main levels folder not found: /levels/')
local function expandMissionFileName(missionFileName)
if FS:directoryExists(missionFileName) then
return missionFileName
local newName = levelPath:sub(0, levelPath:find('main.level.json') - 1)
if FS:directoryExists(newName) then
log('D', '', 'converting level argument to new format: ' .. tostring(levelPath) .. ' > ' .. tostring(newName))
@/lua/ge/extensions/editor/gen/world.lua
local dirname = editor.getLevelPath()..'bat/test/'
if not FS:directoryExists(dirname) then
dirname = editor.getLevelPath()..'bat/'
end
if FS:directoryExists(dirname) then
for _,o in pairs(list) do
-- require 'paths'
-- lo('?? id_BAT:'..tostring(FS:directoryExists(dname)))
if not FS:directoryExists(dname) then
-- lo('?? id_BAT:'..tostring(FS:directoryExists(dname)))
if not FS:directoryExists(dname) then
if FS:directoryCreate(dname, true) ~= 0 then
@/lua/ge/extensions/gameplay/rally/recceApp.lua
if not FS:directoryExists(dirname) then
log('D', logTag, 'creating recce dirs: '..dirname)