VE Lua Documentation

Press F to search!

fileExists

Definition


-- @/=[C]:-1
function fileExists(...)

Callers

@/lua/ge/extensions/editor/flowgraphEditor.lua
            for idx, file in ipairs(recentFiles) do
              if FS:fileExists(file) then
                if im.MenuItem1(idx.." - " .. file) then
@/lua/ge/extensions/editor/buildingEditor.lua
--	local fname = '/lua/ge/extensions/editor/gen/inprod'
	local fprod = FS:fileExists('/lua/ge/extensions/editor/gen/inprod') --io.open(fname, "r")
--			lo('?? if_PROD:'..tostring(fprod))
@/lua/ge/extensions/gameplay/parking.lua
  if type(data) == "string" then
    if FS:fileExists(data) then
      sites = gameplay_sites_sitesManager.loadSites(data)
@/lua/ge/extensions/core/vehicles.lua
    else
      if FS:fileExists(infoFilename) then
        log('E', 'vehicles', 'unable to read info file, ignoring: '.. infoFilename)
    opts.config = 'vehicles/' .. modelName .. '/' .. model.model.default_pc .. '.pc'
  elseif type(opts.config) == 'string' and not string.find(opts.config, '.pc') and FS:fileExists('/vehicles/' .. modelName .. '/' .. opts.config .. '.pc') then
    opts.config = 'vehicles/' .. modelName .. '/' .. opts.config .. '.pc'
    local filename = opts.config
    if not FS:fileExists(filename) then
      filename = '/vehicles/' .. tostring(modelName) .. '/' .. tostring(opts.config)

  if FS:fileExists("settings/cloud/forceLicencePlate.txt") then
    local content = readFile("settings/cloud/forceLicencePlate.txt")
  local design
  if designPath and designPath~="" and FS:fileExists(designPath) then
    design = jsonReadFile(designPath)
      designPath =  'vehicles/common/licenseplates/'..levelName..'/licensePlate-default.json'
      if FS:fileExists(designPath) then
        design = jsonReadFile(designPath)
        local defaultDesignFallBackPath = 'vehicles/common/licenseplates/default/licensePlate-default-'..curFormat..'.json'
        if FS:fileExists(defaultDesignFallBackPath) then
          local defaultDesign = jsonReadFile(defaultDesignFallBackPath)
      if designData.data.characterLayout then
        if FS:fileExists(designData.data.characterLayout) then
          designData.data.characterLayout = jsonReadFile(designData.data.characterLayout)
      if designData.data.generator then
        if FS:fileExists(designData.data.generator) then
          designData.data.generator = "local://local/" .. designData.data.generator
  local vehicle = getPlayerVehicle(0)
  if FS:fileExists(pathDefaultConfig) then
    local data = jsonReadFile(pathDefaultConfig)
@/lua/ge/extensions/editor/trafficManager.lua
    local prefabFilePath = fp..fn..".prefab.json"
    if FS:fileExists(prefabFilePath) then
      local name = generateObjectNameForClass("Prefab", fn)
@/lua/ge/extensions/editor/raceEditor/tools.lua
function C:existsIcon(f)
  if FS:fileExists(f) then
    editor.uiIconImage(editor.icons.check, im.ImVec2(24, 24))
@/lua/ge/extensions/editor/missionEditor.lua

    if not FS:fileExists(raceFname) then
      jsonWriteFile(raceFname, {}, true)
@/lua/ge/extensions/editor/assetDeduplicator.lua
        if job.status == 0 then
          if FS:fileExists(k) then
            local linkTable = {}
              local modFilepath = fileRealPath:gsub(realPath, '')
              if FS:fileExists(modFilepath) then
                local rem2 = FS:removeFile(modFilepath)
    if tableIsEmpty(cacheData) then
      if FS:fileExists(cacheFile) then
        cacheData = jsonReadFile(cacheFile) or {}
@/lua/ge/extensions/editor/resourceChecker.lua
local function texHovered(res)
  if res and not FS:fileExists(res) and string.endswith(res, ".png" ) then
    res = string.gsub(res, ".png", ".dds")
  end
  if res and FS:fileExists(res) then
    local cases = {".dds", ".png", ".bmp", ".jpg", ".jpeg", ".tga"}
        for k,v in pairs(duplicateTable) do
          if FS:fileExists(k) and v.modified == true then
            log('D', '', 'Detected modified material file '..k )
  local shapePreviewSize = 128 * im.uiscale[0]
  if res and FS:fileExists(res) then
    shapePreview:setObjectModel(res)
        if o and o.getFileName then
          if FS:fileExists(o:getFileName()) then Engine.Platform.exploreFolder(o:getFileName()) else log('E', '', 'Path :'..tostring(o:getFileName())..' does not exist' ) end
        end
        end
        if FS:fileExists(res) then Engine.Platform.exploreFolder(res) else log('E', '', 'Path :'..tostring(res)..' does not exist' ) end
      end
        end
        if FS:fileExists(res) then
          local cases = {".dds", ".png", ".bmp", ".jpg", ".jpeg", ".tga"}
        jsonWriteFile(path, resExplorer[6][res], true)
        if FS:fileExists(path) then Engine.Platform.exploreFolder(path) else log('E', '', 'Path :'..path..' does not exist' ) end
        im.CloseCurrentPopup()
        end
        if FS:fileExists(res) then im.SetClipboardText(res) else log('E', '', 'Path :'..tostring(res)..' does not exist' ) end
        im.CloseCurrentPopup()
        end
        if FS:fileExists(res) then dump(FS:stat(res)) else log('E', '', 'Path :'..tostring(res)..' does not exist' ) end
        im.CloseCurrentPopup()
        path = tostring(v):match(".*. (.+)")
        if path and FS:fileExists(path) then
        elseif tostring(v) and string.match(tostring(v), " ") then
          path = tostring(v):match("^(%S+)%s+(.+)")
          if path and FS:fileExists(path) then end
        else
        elseif testName == "tsstatics" or testName == "forestitems" or testName == "unusedMesh" or testName == "missingMat" or testName == "colData" then
          if FS:fileExists(tostring(v)) then
            shapeHovered(tostring(v))
      end
      if FS:fileExists(path) then Engine.Platform.exploreFolder(path) else log('E', '', 'Path :'..path..' does not exist' ) end
    end
  if not path or path == "" then return end
  if FS:fileExists(path) then Engine.Platform.exploreFolder(path)
  else log('E','', 'Path :'..tostring(path)..' does not exist') end
@/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/extensions/editor/rallyEditor.lua
local function devTxtExists()
  return FS:fileExists('dev.txt')
end
@/lua/ge/extensions/core/settings/settings.lua
        local infoFname = compositorsDir..key..'/info.json'
        if FS:fileExists(infoFname) then
          local info = jsonReadFile(infoFname)
  local translationsFilename = '/mods/translations.zip'
  if FS:fileExists(translationsFilename) and not FS:isMounted(translationsFilename) then
    FS:mount(translationsFilename)
@/lua/ge/extensions/ui/vehicleSelector/general.lua
  end
  if FS:fileExists(pathDefaultConfig) then
    local data = jsonReadFile(pathDefaultConfig)
@/lua/ge/extensions/gameplay/missions/missionTypes/editorHelper.lua
  if not config then
    config = FS:fileExists(mtd[e.fieldNameConfigPath])
  end
  local file = ffi.string(e.ac)
  local foundFile = file ~= "" and (FS:fileExists(file) or  FS:fileExists(m.missionFolder..'/'..file))
  if not foundFile then
  local file = ffi.string(e.ac)
  local foundFile = file ~= "" and (FS:fileExists(file) or  FS:fileExists(m.missionFolder..'/'..file))
  if not foundFile then
  for _, file in ipairs(e.filepathsInMissionfolder) do
    if FS:fileExists(m.missionFolder .. file) then
      foundFile = m.missionFolder .. file
  if e.foundFile == nil then
    e.foundFile = file ~= "" and (FS:fileExists(file) or  FS:fileExists(mission.missionFolder..'/'..file))
  end
  if e.foundFile == nil then
    e.foundFile = file ~= "" and (FS:fileExists(file) or  FS:fileExists(mission.missionFolder..'/'..file))
  end
    for _, file in ipairs(e.filepathsInMissionfolder) do
      if FS:fileExists(mission.missionFolder .. file) then
        e.foundFile = mission.missionFolder .. file
@/lua/ge/extensions/editor/shapeEditor.lua
  local mcf = path .. filename
  if FS:fileExists(mcf) then
    local data = readFile(mcf)
local function showShapeEditorLoadFile(filename)
  if not FS:fileExists(filename) then
    log("E","showShapeEditorLoadFile", "File doesn't exist")
@/lua/ge/extensions/gameplay/rally/util.lua

  if not FS:fileExists(notebookFname) then
    log('E', logTag, 'unable to load notebook: notebook file not found: '..notebookFname)

  if not FS:fileExists(raceFname) then
    return nil, "race file not found: "..raceFname
@/lua/ge/extensions/core/hotlapping.lua
  -- new method, load from race path file
  if FS:fileExists(filePath) then
    local json = jsonReadFile(filePath)
  local pre = rootDir..getCurrentLevelIdentifier() ..'/'
  if not FS:fileExists(pre..oldName..'.race.json') then
    log('W', logTag, 'Failed renaming '..oldName..' to '..newName..': File not found')
@/lua/vehicle/sounds.lua
local function checkLocalFile(folder, file)
  if not FS:fileExists(file) then
    local testfn = folder .. file
    local testfn = folder .. file
    if FS:fileExists(testfn) then
      return testfn
@/lua/ge/extensions/editor/decalEditor.lua
  local fileNameNoExt = string.sub(fileName, 1, -(ext:len() + 1))
  if not FS:fileExists(fileNameNoExt .. "png") and not FS:fileExists(fileNameNoExt .. "dds") then
    -- We have to create the correct path ourselves
  local fileNameNoExt = string.sub(fileName, 1, -(ext:len() + 1))
  if not FS:fileExists(fileNameNoExt .. "png") and not FS:fileExists(fileNameNoExt .. "dds") then
    -- We have to create the correct path ourselves
@/lua/ge/extensions/util/compileMeshes.lua
          cacheFilename = cacheDir .. '/' .. src_hash .. '.cdae'
          --print('cacheFilename = ' .. tostring(cacheFilename) .. ' / ' .. tostring(FS:fileExists(cacheFilename)))
          if FS:fileExists(cacheFilename) then
          --print('cacheFilename = ' .. tostring(cacheFilename) .. ' / ' .. tostring(FS:fileExists(cacheFilename)))
          if FS:fileExists(cacheFilename) then
            --print(' cache file found, using it: ' .. cacheFilename)
		  if tableFindKey(cmdArgs, '-compileMeshesNoCompileOnlyCheck') then
			if FS:fileExists(dst) then
			  compiledFiles[src] = 3
@/lua/ge/extensions/editor/gen/exp_meshexplorer.lua
        fsnode.adir = W.dir2list()
--        FS:fileExists('/save/exp/favdir.json')
    elseif key == 'dir_up' then
@/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/ui/liveryEditor/editor.lua
M.loadFile = function(file)
  if not FS:fileExists(file) then
    log("W", "", "File " .. file .. " not found")
@/lua/ge/extensions/editor/rallyEditor/drivelineTab.lua
  local drivelineFile = rallyUtil.drivelineFile(missionDir)
  return FS:fileExists(drivelineFile)
end
  local finalFile = rallyUtil.finalDrivelineFile(missionDir)
  return FS:fileExists(finalFile)
end
@/lua/ge/client/postFx.lua
  local presetFilename = FS:expandFilename(filename)
  if FS:fileExists(presetFilename) then
    presetFilename = makeRelativePath( presetFilename, "")
  local presetFilename = "settings/default.postfxpreset.cs"
  if FS:fileExists(FS:expandFilename(presetFilename)) then
    log('I', 'postfx', "PostFX Manager - migrating cs version of default preset")
@/lua/console/resave-pcs.lua
            if string.endswith(file, ".pc") then
                if FS:fileExists(vdir.."/"..file) then
                    table.insert(files, file)
@/lua/ge/extensions/flowgraph/manager.lua
  for _, path in ipairs(files) do
    if FS:fileExists(path) then
      return path, true
@/lua/ge/extensions/editor/rallyEditor/pacenotes/pacenoteForm.lua
  fname = pacenote:audioFnameFreeform()
  if FS:fileExists(fname) then
    file_exists = true
@/lua/ge/extensions/core/input/bindings.lua
      local targetPath = dir.."/sce_pad_standard.diff"
      if not FS:fileExists(targetPath) then
        -- build candidate paths from settings/scePadGuids.json
        for _, p in ipairs(candidatePaths) do
          if FS:fileExists(p) then
            sourcePath = p
@/lua/ge/extensions/editor/api/dynamicDecals/textures.lua
local function sidecarFileExists(textureFilepath)
  return FS:fileExists(textureFilepath .. sidecarExtension)
end
  -- remove tags and refs
  if FS:fileExists(sidecarFilePath) then
    local oldData = jsonReadFile(sidecarFilePath)
  missingSidecarFiles = {}
  if not FS:fileExists(sidecarFilePath) then
    table.insert(missingSidecarFiles, filepath)
        -- remove tags and refs
        if FS:fileExists(sidecarFilePath) then
          local oldData = jsonReadFile(sidecarFilePath)
@/lua/ge/extensions/editor/camPathEditor.lua
  end
  return FS:fileExists(replay)
end
@/lua/ge/extensions/editor/missionEditor/genericTypeData.lua
  local luaPath = reqPath..".lua"
  if not FS:fileExists(luaPath) then
    log("W", "", "found no editor for mission type " .. missionType ..": "..dumps(luaPath))
@/lua/ge/extensions/util/trackBuilder/splineTrack.lua
    local filename = 'trackEditor/'..originalFilename..'.json'
    if FS:fileExists(filename) then
      read = jsonReadFile(filename)

  if FS:fileExists(filename) then
    local read = jsonReadFile(filename)
  local pre = 'trackEditor/'
  if not FS:fileExists(pre..oldName..'.json') then
    log('I', logTag, 'Failed renaming '..oldName..' to '..newName..': File not found')
@/lua/ge/extensions/editor/util/zoneSelectorUtil.lua
  -- Check if file exists
  if not FS:fileExists(sitesFile) then
    e.loadedZones = {}
@/lua/ge/extensions/career/modules/inventory.lua
    vehicles[vehicleData.id] = vehicleData
    if tableIsEmpty(core_vehicles.getModel(vehicleData.model)) or not FS:fileExists(vehicleData.config.partConfigFilename) then
      vehicleData.missingFile = true
    -- if the vehicle doesnt exist (deleted mod) then dont spawn
    if tableIsEmpty(core_vehicles.getModel(carModelToLoad)) or not FS:fileExists(vehInfo.config.partConfigFilename) then
      return
  local thumbnailPath = savePath .. "/career/vehicles/" .. inventoryId .. ".png"
  if not vehicle.defaultThumbnail and FS:fileExists(thumbnailPath) then
    return thumbnailPath
@/lua/ge/extensions/gameplay/missions/proceduralMissionGenerators/timeTrialMissions.lua
  if not cachedRaceFiles[cacheFile] then
    if not FS:fileExists(cacheFile) then
      local path = require('/lua/ge/extensions/gameplay/race/path')("New Race")
                local file = "/levels/"..level.levelName.."/quickrace/"..race.trackName..ext
                if FS:fileExists(file) then
                  previewFilenameExt = ext
              for i, p in ipairs(mission.missionTypeData[key] or {}) do
                if not FS:fileExists(p) then
                  local found = false
                    local file = "levels/"..level.levelName.."/"..p..ext
                    if FS:fileExists(file) then
                      mission.missionTypeData[key][i] = file
                local file = "levels/"..level.levelName.."/quickrace/"..race.trackName..suf..ext
                if FS:fileExists(file) then
                  table.insert(mission.missionTypeData[list], file)
@/lua/ge/extensions/editor/biomeTool.lua

  if FS:fileExists(levelDataPath) then
    var.layers = jsonReadFile(levelDataPath)
  local layerAvailable = not tableIsEmpty(areaLayers) or not tableIsEmpty(terrLayers)
  if FS:fileExists(biomeDataPath) then
    FS:removeFile(biomeDataPath)
@/lua/ge/extensions/gameplay/discover.lua
    local popup = "basicDriving_"..v.imagePack
    if FS:fileExists("/gameplay/discover/popups/"..popup.."/content.html") then
      if not doneIntroPopups[popup] then
  local file = "/gameplay/discover/popups/"..id.."/content.html"
  if not FS:fileExists(file) then
    return
@/lua/ge/extensions/editor/gen/utils.lua
	--'conf'
U._HERE = FS:fileExists('/lua/ge/extensions/editor/gen/inprod')
--U._DEMO = true
}
--	print('??++++++++++++++++++++++++++++++++++++++++++++++++ UTILS_PREPROD:'..tostring(FS:fileExists('/lua/ge/extensions/editor/gen/inprod')))
@/lua/ge/extensions/scenario/raceGoals.lua
      for _, file in ipairs(goalPaths) do
        if FS:fileExists('lua/ge/extensions/'..file..'.lua') then
          goal = require(file)
@/lua/ge/extensions/editor/rallyEditor/pacenotes/customForm.lua

  if fname and fname ~= "" and FS:fileExists(fname) then
    file_exists = true
@/lua/ge/extensions/gameplay/rally/recce/drivelineRecording.lua

  if not FS:fileExists(fname) then
    log('W', logTag, 'driveline file not found: ' .. fname)
@/lua/vehicle/extensions/vehicleStatsLogger.lua
  local i = 1
  while not FS:fileExists(fn) do
    fn = get_fname(i)
@/lua/ge/extensions/core/cameraModes/path.lua
  if replay == "" then return false end
  return FS:fileExists(replay)
end
@/lua/ge/extensions/gameplay/traffic/trafficUtils.lua
  if not rolesCache[roleName] then
    if not FS:fileExists('/lua/ge/extensions/gameplay/traffic/roles/'..roleName..'.lua') then
      log('W', logTag, 'Traffic role does not exist: '..roleName)
@/lua/ge/extensions/gameplay/missions/missionScreen.lua
            -- Delete the file
            if FS:fileExists(filePath) then
              FS:removeFile(filePath)
@/lua/ge/extensions/editor/perfProfiler.lua
      local annotation = nil
      if FS:fileExists(annotationFileName) then
        annotation = jsonReadFile(annotationFileName)
        dump(file)
        if FS:fileExists(file) then
          fileData.meta.annotation = jsonReadFile(file)
@/lua/ge/extensions/freeroam/freeroamConfigurator.lua
  -- If config ends in .pc, add it to the list
  if config and string.endswith(config, ".pc") and FS:fileExists(config) then
    table.insert(validationFiles, config)
  if configData then
    if configData.infoFilename and FS:fileExists(configData.infoFilename) then
      table.insert(validationFiles, configData.infoFilename)
    end
    if configData.pcFilename and FS:fileExists(configData.pcFilename) then
      table.insert(validationFiles, configData.pcFilename)
    end
    if configData.preview and FS:fileExists(configData.preview) then
      table.insert(validationFiles, configData.preview)
    if string.match(file, "[^/]+%.[%w]+$") then
      if not FS:fileExists(file) then
        return false
@/lua/ge/extensions/scenario/quickRaceLoader.lua

        if FS:fileExists('trackEditor/'..name..'.jpg') then
          file.previews = {'/trackEditor/'..name..'.jpg'}
          file.previews = {'/trackEditor/'..name..'.jpg'}
        elseif FS:fileExists('trackEditor/'..name..'.png') then
          file.previews = {'/trackEditor/'..name..'.png'}

  if FS:fileExists(filename) then
    local read = jsonReadFile(filename)
        local officialPath = trackFile
        file.official = FS:fileExists(officialPath) and isOfficialContentVPath(officialPath)
        end
        if not FS:fileExists("/levels/"..levelName..'/'..file.startHTML) then
          if not htmldiscovered then
      local file = "levels/"..scenarioFile.levelName.."/quickrace/"..trackFile.trackName..suf..ext
      if FS:fileExists(file) then
        table.insert(trackFile[list], file)
@/lua/ge/extensions/gameplay/rally/util/jsonlUtils.lua
function M.parseJsonlFile(fname, processLine, rallyUtil)
  if not FS:fileExists(fname) then
    return nil, "file not found"
function M.readJsonlLines(fname, callback)
  if not FS:fileExists(fname) then
    return false
@/lua/ge/extensions/editor/mainToolbar.lua
local function loadEditModeSets()
  if FS:fileExists(settingsPath) then
    local success, data = pcall(jsonReadFile, settingsPath)
@/lua/ge/extensions/editor/scriptAIManager.lua
    im.SameLine()
    if FS:fileExists(persistenceFilename) and im.SmallButton("load") then
      M.onDeserialized(jsonReadFile(persistenceFilename))
@/lua/ge/extensions/gameplay/rally/driveline/drivelineV3.lua
  local finalDrivelineFile = rallyUtil.finalDrivelineFile(self.missionDir)
  if not FS:fileExists(finalDrivelineFile) then
    log('E', logTag, 'Final driveline file not found: ' .. finalDrivelineFile)
@/lua/ge/extensions/util/docCreator.lua

        if string.len(v) > 0 and FS:fileExists(v) then
          local orgFilename = v
          local outFilename = outputFolderResources .. newFilename
          if not FS:fileExists(outFilename) then
            FS:copyFile(v, outFilename)
@/lua/ge/extensions/core/repository.lua
  local targetFilename = localPath .. filename
  if FS:fileExists("/mods/"..filename) then
    FS:removeFile("/mods/"..filename)
      guihooks.trigger("toastrMsg", {type="error", title="Repo Error", msg="Could not download the file (Check console for details)"})
      if FS:fileExists(r.outfile) then
        FS:removeFile(r.outfile)
    end
    --print("EXISTS: " .. tostring(FS:fileExists(r.outfile)))
    if not FS:fileExists(r.outfile) then
    --print("EXISTS: " .. tostring(FS:fileExists(r.outfile)))
    if not FS:fileExists(r.outfile) then
      log('E', 'repo.downloadFinishedCallback', 'unable to download file: ' .. tostring(uri) .. ' / File missing: ' .. tostring(r.outfile) .. ' / reply: ' .. dumps(r))
      logOnline("requestMod",request)
      if( FS:fileExists("mod_info/"..mod_id.."/info.json")) then
        requestModOffline(mod_id)
@/lua/ge/extensions/gameplay/rally/recceSettings.lua

  if not FS:fileExists(self.fname) then
    log('W', logTag, 'load: recce settings fname doesnt exist: '..tostring(self.fname))
@/lua/ge/screenshot.lua
      counter = counter + 1
    until not FS:fileExists(filepath)
    finalPath = screenPath .. '/' .. filename_without_ext
    screenshotNumber = screenshotNumber + 1
  until not FS:fileExists(fullFilename)
  log('I','screenshot', "writing screenshot: " .. fullFilename)
@/lua/ge/extensions/gameplay/rally/notebook/pacenote.lua
    end
    if not FS:fileExists(fname) then
      -- log('E', logTag, "checkFilesExist: cant find "..audioMode.." file for pacenote=" .. self.name .. " fname=" .. fname)
@/lua/common/libs/xlsxlib/tests/tests.lua
  local fn = dataPath .. expectedFile
  if not FS:fileExists(fn) then
@/lua/ge/extensions/gameplay/rally/recce/cutsRecording.lua

  if FS:fileExists(fname) then
    jsonlUtils.readJsonlLines(fname, function(obj)
  local fname = rallyUtil.cutsFile(missionDir)
  if not FS:fileExists(fname) then
    log('I', logTag, 'no cuts file found: '..fname)
@/lua/ge/extensions/util/terrainGenerator.lua
function C:createTerrain() -- creates a terrain block from the saved parameters (heightmap, materials, height, scale, etc.)
  if not self.heightMap or (string.find(self.heightMap, '/') and not FS:fileExists(self.heightMap)) then
    log('E', logTag, 'Heightmap file not found: '..tostring(self.heightMap))

  if not self.holeMap or (string.find(self.holeMap, '/') and not FS:fileExists(self.holeMap)) then
    self.holeMap = ''
@/lua/ge/extensions/editor/raceEditor/timeTrials.lua
  self.previewPath = self.path._dir .. self.path._fnWithoutExt .. '.jpg'
  if FS:fileExists(self.previewPath) then
    previewTex = imu.texObj(self.previewPath)
  for i, f in ipairs(files) do
    if f ~= "" and FS:fileExists(f) then
      at = f
@/lua/ge/extensions/ui/ambientSound.lua
    local curSound =soundStreams[i].currentSoundData
    if FS:fileExists(curSound.currentSound) then
      if curSound.playing ==false then
local function init(json)
  if not FS:fileExists(json) then
    log('E',json .. "not Exist")
@/lua/ge/extensions/util/worker.lua
local function compileDae(daePath)
  if not FS:fileExists(daePath) then
    log('E', 'util_worker.compileDae', 'filename not existing: ' .. tostring(daePath))
N.testImage = function(w)
  if not FS:fileExists(w.filename) then
    log('E', 'util_worker.testImage', 'filename not existing: ' .. tostring(w.filename))
@/lua/ge/extensions/editor/api/gui.lua
  local wstate = jsonReadFile(finalFilename) or {}
  local wstateFileExists = FS:fileExists(finalFilename)
@/lua/ge/extensions/editor/forestEditor.lua
local function readOrIntializeParallaxMappingTextureSets()
  if FS:fileExists(pM_textureSetsFilePath) then
    pM_textureSets = jsonReadFile(pM_textureSetsFilePath)
    local brushPath = var.levelPath .. "/main.forestbrushes4.json"
    if FS:fileExists(brushPath) then
      Sim.deserializeLineObjects(brushPath, true)
@/lua/ge/extensions/tech/techCore.lua
    local infoPath = '/levels/' .. tostring(sc.levelName) .. '/info.json'
    if not FS:fileExists(infoPath) then
      local msg = 'Level not found: "' .. tostring(sc.levelName) .. '"'
    local otherPrefabPath = path .. name .. otherExtension
    if FS:fileExists(FS:expandFilename(otherPrefabPath)) then
      log('I', logTag, 'Deleting previous scenario prefab file \'' .. otherPrefabPath .. '\', as it is in a different format.')
  local trackPath = request['path']
  if not FS:fileExists(trackPath) then
    request:sendBNGValueError('The track file does not exist.')
@/lua/ge/extensions/editor/resourceChecker/resourceUtil.lua
local function safeFileSize(path)
  if not path or not FS:fileExists(path) or FS:isLinkFile(path) then return 0 end
  local s = FS:fileSize(path)
local function resaveMaterial(file)
  if file and FS:fileExists(file) then
    local persistenceMgr = PersistenceManager()
                  if d:find(".color.png") or d:find(".data.png") or d:find(".normal.png") then
                    if not (FS:fileExists(dir..basefilename..".png") or FS:fileExists(dir..basefilename..".dds")) then
                      fileIsMissing[e][k][m] = d.."   Reason: File not found"
                  if d:find(".color.png") or d:find(".data.png") or d:find(".normal.png") then
                    if not (FS:fileExists(dir..basefilename..".png") or FS:fileExists(dir..basefilename..".dds")) then
                      fileIsMissing[e][k][m] = d.."   Reason: File not found"
                  elseif dir then
                    if not FS:fileExists(dir..basefilename..b) then fileIsMissing[e][k][m] = d.."   Reason: File not found" end
                  end
                  if d:find(".color.dds") or d:find(".data.dds") or d:find(".normal.dds") then
                    if FS:fileExists(dir..basefilename..".png") or FS:fileExists(dir..basefilename..".dds") then
                      incorrectPathCooker[e][k][m] = d.."   Reason: cannot be cooked, wrong postfix, use png in texture cooker files"
                  if d:find(".color.dds") or d:find(".data.dds") or d:find(".normal.dds") then
                    if FS:fileExists(dir..basefilename..".png") or FS:fileExists(dir..basefilename..".dds") then
                      incorrectPathCooker[e][k][m] = d.."   Reason: cannot be cooked, wrong postfix, use png in texture cooker files"
            job.yield()
            if d and d ~= "" and FS:fileExists(d) then
              local tex = im.ImTextureHandler(d)
    local cacheSize = 0
    if FS:fileExists(k:gsub('.dae','.cdae')) then
      local fsize2 = safeFileSize(k:gsub('.dae','.cdae'))
      sizecache = sizecache + fsize2
    elseif FS:fileExists('/temp/'..k:gsub('.dae','.cdae')) then
      local fsize2 = safeFileSize('/temp/'..k:gsub('.dae','.cdae'))
    local cacheSize = 0
    if FS:fileExists(k:gsub('.dae','.cdae')) then
      local fsize2 = safeFileSize(k:gsub('.dae','.cdae'))
      sizecache = sizecache + fsize2
    elseif FS:fileExists('/temp/'..k:gsub('.dae','.cdae')) then
      local fsize2 = safeFileSize('/temp/'..k:gsub('.dae','.cdae'))
      job.yield()
      if FS:fileExists(k) then
        local shapeLoader = ShapePreview()
      job.yield()
      if FS:fileExists(k) then
        local shapeLoader = ShapePreview()
            if file:find(".color.png") or file:find(".data.png") or file:find(".normal.png") then
              if FS:fileExists(file:gsub('.png', '.dds')) then
                file = file:gsub('.png', '.dds')
                file = file:gsub('.png', '.dds')
              elseif FS:fileExists('/temp/'..file:gsub('.png', '.dds')) then
                file = '/temp/'..file:gsub('.png', '.dds')
            end
            if FS:fileExists(file) then
              local fileData = FS:stat(file)
              end
            elseif matName and not FS:fileExists(file) then
              local dir = path.splitWithoutExt(matName)
              local d, base, ext = path.splitWithoutExt(matName)
              if d and base and FS:fileExists(d..file) then
                local fileData = FS:stat(d..file)
      job.yield()
      if FS:fileExists(k) then
        local shapeLoader = ShapePreview()
            local modFilepath = fileRealPath:gsub(realPath, '')
            if FS:fileExists(modFilepath) then
              local rem2 = FS:removeFile(modFilepath)
            local modFilepath = fileRealPath:gsub(realPath, '')
            if FS:fileExists(modFilepath) then
              local rem2 = FS:removeFile(modFilepath)
    for file,mats in pairs(dummyMat) do
      if FS:fileExists(file) then
        local materialFile = jsonReadFile(file) or {}
      if abort(job) then return end
      if v and not FS:fileExists(v:gsub('.dds', '.png')) then
        local dir, basefilename = path.splitWithoutExt(v)
      local cache = nil
      if FS:fileExists(k:gsub('.dae','.cdae')) then cache = k:gsub('.dae','.cdae')
      elseif FS:fileExists(k:gsub('.dts','.cached.dts')) then cache = k:gsub('.dts','.cached.dts')
      if FS:fileExists(k:gsub('.dae','.cdae')) then cache = k:gsub('.dae','.cdae')
      elseif FS:fileExists(k:gsub('.dts','.cached.dts')) then cache = k:gsub('.dts','.cached.dts')
      elseif FS:fileExists('/temp/'..k:gsub('.dae','.cdae')) then cache = '/temp/'..k:gsub('.dae','.cdae')
      elseif FS:fileExists(k:gsub('.dts','.cached.dts')) then cache = k:gsub('.dts','.cached.dts')
      elseif FS:fileExists('/temp/'..k:gsub('.dae','.cdae')) then cache = '/temp/'..k:gsub('.dae','.cdae')
      elseif FS:fileExists('/temp/'..k:gsub('.dts','.cached.dts')) then cache = '/temp/'..k:gsub('.dts','.cached.dts')
      elseif FS:fileExists('/temp/'..k:gsub('.dae','.cdae')) then cache = '/temp/'..k:gsub('.dae','.cdae')
      elseif FS:fileExists('/temp/'..k:gsub('.dts','.cached.dts')) then cache = '/temp/'..k:gsub('.dts','.cached.dts')
      end
            if f:find(".color.png") or f:find(".data.png") or f:find(".normal.png") then
              if FS:fileExists(f:gsub('.png','.dds')) then f = f:gsub('.png','.dds')
              elseif FS:fileExists('/temp/'..f:gsub('.png','.dds')) then f = '/temp/'..f:gsub('.png','.dds') end
              if FS:fileExists(f:gsub('.png','.dds')) then f = f:gsub('.png','.dds')
              elseif FS:fileExists('/temp/'..f:gsub('.png','.dds')) then f = '/temp/'..f:gsub('.png','.dds') end
            end
            end
            if not seenTex[f] and FS:fileExists(f) then
              seenTex[f] = true
@/lua/ge/extensions/core/modmanager.lua
      v[1] = v[1]:gsub("\\/","/")
      if FS:fileExists(v[1]) then
        local hash = FS:hashFile(v[1])
  local zip = ZipArchive()
  if not zip:openArchiveName( filename, "R" ) and FS:fileExists(filename) then
    local errMsg = "Invalid ZIP file: "..dumps(filename)
      uniqueModList[modname] = filepath
      if string.endswith(filepath, ".zip" ) and FS:fileExists(filepath) then
        -- log('D', 'checkDuplicatedMods', "opening zip")
    M.deleteMod(v.name)
    if FS:fileExists(v.path) then log('D', 'checkDuplicatedMods', "delete '"..tostring(v.path).."' = "..dumps(FS:removeFile(v.path)) ) end
    if FS:fileExists(v.path) then
    if FS:fileExists(v.path) then log('D', 'checkDuplicatedMods', "delete '"..tostring(v.path).."' = "..dumps(FS:removeFile(v.path)) ) end
    if FS:fileExists(v.path) then
      log('E', 'checkDuplicatedMods', "failed to delete "..tostring(v.path))
  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
    local zip = ZipArchive()
    if zip:openArchiveName( mods[modname].fullpath, "R" ) and FS:fileExists(mods[modname].fullpath) then
      local filesInZIP = zip:getFileList()
    local zip = ZipArchive()
    if zip:openArchiveName( mods[modname].fullpath, "R" ) and FS:fileExists(mods[modname].fullpath) then
      local filesInZIP = zip:getFileList()
  local dir, basefilename, ext = path.splitWithoutExt(filename)
  if ext == 'zip' and FS:fileExists(filename) and (type == 'added' or type == 'modified') then
    log('D', '', tostring(filename) .. ' : ' .. tostring(type) .. ' > ' .. tostring(ext))
    end
    if oldMod == nil and not FS:fileExists("/mods/"..oldFileName) then
      guihooks.trigger('modmanagerError', "updateZipMod: Old ZIP not found")
@/lua/ge/extensions/gameplay/drift/saveLoad.lua
    local f = dir..fn
    if FS:fileExists(f) then
      return f
@/lua/ge/extensions/util/screenshotCreator.lua

          local skip = workOptions.onlyMissingThumbnails and windowOpen[0] and ctrls.currOuputDestinationPtr[0] == 0 and FS:fileExists(filepath)
@/lua/ge/extensions/editor/flowgraph/welcome.lua
  for k, file in ipairs(recentFiles) do
    if FS:fileExists(file) then
      local dir, filename, ext = path.split(file, true)
@/lua/ge/extensions/editor/util/editorElementHelper.lua
  if not config then
    config = FS:fileExists(ctd[e.fieldNameConfigPath])
  end
  if mode == 'mission' then
    foundFile = file ~= "" and (FS:fileExists(file) or FS:fileExists(c.missionFolder..'/'..file))
  else
  if mode == 'mission' then
    foundFile = file ~= "" and (FS:fileExists(file) or FS:fileExists(c.missionFolder..'/'..file))
  else
  else
    foundFile = file ~= "" and (FS:fileExists(file))
  end
  for _, file in ipairs(e.filepathsInfolder) do
    if FS:fileExists(c.missionFolder .. file) then
      foundFile = c.missionFolder .. file
  if e.foundFile == nil then
    e.foundFile = file ~= "" and (FS:fileExists(file) or  FS:fileExists(container.missionFolder..'/'..file))
  end
  if e.foundFile == nil then
    e.foundFile = file ~= "" and (FS:fileExists(file) or  FS:fileExists(container.missionFolder..'/'..file))
  end
  for _, path in ipairs(files) do
    if FS:fileExists(path) then
      return path, true
    for _, file in ipairs(searchFiles) do
      if FS:fileExists(file) then
        e.foundFile = file
@/lua/ge/extensions/gameplay/rally/trafficExclusion.lua

  if not FS:fileExists(racePathFile) then
    log('D', logTag, "Race path file not found: " .. tostring(racePathFile))
@/lua/ge/extensions/editor/dynamicDecals/brushes.lua

  if FS:fileExists(brushesPath) then
    brushes = jsonReadFile(brushesPath)
@/lua/ge/extensions/editor/rallyEditor/static.lua
      local voicePlayClr = nil
      local file_exists = FS:fileExists(variant.audioFname)
      if editor.uiIconImageButton(editor.icons.play_circle_filled, im.ImVec2(20, 20), voicePlayClr) then
        if FS:fileExists(variant.audioFname) then
          Engine.Audio.intercomPlayPacenote({ filename=variant.audioFname })
  --       local voicePlayClr = nil
  --       local file_exists = FS:fileExists(fname)
  --       fname = spn:audioFnameFreeform(codriver)
  --       if FS:fileExists(fname) then
  --         file_exists = true
@/lua/ge/extensions/editor/dynamicDecals/debugSection.lua

      if FS:fileExists(matPath) then
        local data = jsonReadFile(matPath)
@/lua/ge/extensions/ui/uiNavi.lua

  if FS:fileExists(getMissionFilename()) then
    info = jsonReadFile(getMissionFilename())
@/lua/ge/extensions/campaign/exploration.lua

    if FS:fileExists(prefabPath) then
      if not scenetree.findObject(prefabName) then
@/lua/ge/extensions/freeroam/freeroam.lua
      local relativePath = level.misFilePath..absolutePath
      local path = FS:fileExists(absolutePath) and absolutePath or (FS:fileExists(relativePath) and (relativePath) or nil)
      if path then
      local relativePath = level.misFilePath..absolutePath
      local path = FS:fileExists(absolutePath) and absolutePath or (FS:fileExists(relativePath) and (relativePath) or nil)
      if path then
  file = path .. 'mainLevel'
  if not FS:fileExists(file..'.lua') then return end
  extensions.loadAtRoot(file,"")
@/lua/ge/extensions/campaign/photoSafari.lua
  if not file then return end
  if FS:fileExists(file) then
    M.photoSafariData = jsonReadFile(file)
@/lua/ge/extensions/core/replay.lua
  if not replayFileName or replayFileName == "" then return end
  if FS:fileExists(replayFileName) then
    Engine.Platform.exploreFolder(replayFileName)
@/lua/common/utils/simpleHttpServer.lua
  local fn = fileroot .. path
  if not FS:fileExists(fn) then
    -- existing?
@/lua/ge/extensions/core/trafficSignals.lua
  shapeFile = shapeFile or 'art/shapes/objects/trafficlight_overhead1.dae'
  if not FS:fileExists(shapeFile) then
    local artDir = path.split(getMissionFilename()) or '' -- first, search the current level assets

    if not FS:fileExists(shapeFile) then
      artDir = 'art/shapes/' -- if not found, then search the common assets

    if not FS:fileExists(shapeFile) then
      log('E', logTag, 'Unable to find given shape file!')

  if FS:fileExists(filePath) then
    local defs = jsonReadFile(filePath)

  if FS:fileExists(filePath) then
    local data = jsonReadFile(filePath)
@/gameplay/missionTypes/rallyLoop/constructor.lua
  local function loadWaypointsFromRace(raceFilePath)
    if not FS:fileExists(raceFilePath) then
      return {}
@/lua/ge/extensions/editor/materialEditor.lua
              pushIssue(key, 3, "PNG without texture cooker suffix (.color/.normal/.data): " .. rel)
            elseif not FS:fileExists(abs) then
              pushIssue(key, 1, "Texture cooker source file not found: " .. rel)
      local shape = defObj:getField("shapeFile", 0)
      if shape and shape ~= "" and FS:fileExists(shape) then
        shapeLoader:setObjectModel(shape)
  local p = res
  if not string.startswith(p or '', '/') and FS:fileExists('/'..(p or '')) then
    p = '/'..p
      local p = resolvePath(res)
      if p and FS:fileExists(p) then
        Engine.Platform.exploreFolder(p)
      local p = resolvePath(res)
      if p and FS:fileExists(p) then
        if editor_shapeEditor then editor_shapeEditor.showShapeEditorLoadFile(p) end
    local p = resolvePath(absPath)
    if p and p ~= "" and FS:fileExists(p) then Engine.Platform.exploreFolder(p) else log('E', '', 'Path :'..p..' does not exist' ) end
  end
      local p = resolvePath(filepath)
      if p and p ~= "" and FS:fileExists(p) then Engine.Platform.exploreFolder(p) else log('E', '', 'Path :'..p..' does not exist' ) end
    end
            end
            if tmp ~= "" and FS:fileExists(filepath) then
              log("D", "reloadTex", dumps(k).."["..dumps(i).."]="..dumps(filepath))
@/lua/ge/extensions/editor/rallyEditor/pacenotes/structuredForm.lua
  for i,fname in ipairs(fnames) do
    if FS:fileExists(fname) then
      file_exists = true
@/lua/ge/extensions/editor/crawlEditor/trails.lua
          -- Delete the file from disk
          if trail._filePath and FS:fileExists(trail._filePath) then
            FS:removeFile(trail._filePath)
@/lua/ge/client/init.lua
    --TODO: check funcs
    if FS:fileExists(FS:expandFilename("./audioData.cs")) then
      TorqueScriptLua.exec( "./audioData.cs" )
  --TODO: check funcs
  if FS:fileExists(FS:expandFilename("./audioData.cs")) then
    TorqueScriptLua.exec( "./audioData.cs" )
@/lua/ge/extensions/gameplay/missions/progress.lua
  local file = {}
  if FS:fileExists(permaLogFile) then
    local state, result = xpcall(function()

  if FS:fileExists(path) then
    local state, result = xpcall(function()
@/lua/ge/extensions/gameplay/rally/audioManager.lua
    -- Check if system audio file exists
    if not pacenote.audioFname or pacenote.audioFname == '' or not FS:fileExists(pacenote.audioFname) then
      log('E', logTag, string.format("enqueueSystemPacenote: audio file not found: %s", tostring(pacenote.audioFname)))
@/lua/ge/extensions/gameplay/race/path.lua
        local file = trackInfo.directory..trackInfo.trackName..suf..ext
        if FS:fileExists(file) then
          table.insert(merged, file)
@/lua/ge/extensions/editor/fileDialog.lua
          end
          if FS:fileExists(currentPath..fname) then
            cbdata = {path=currentPath, action=action, filename=fname, filepath=currentPath..fname, filestat = "overwrite"}
@/lua/ge/extensions/editor/terrainEditor.lua
              local drewPreview = false
              if prev and prev ~= "" and FS:fileExists(prev) then
                local texObj = editor.getTempTextureObj(prev)  -- was leftPath (undefined); use prev
  terrainFolder = "/art/terrain/"
  if not FS:fileExists(var.levelPath .. matFilePath) then
    if FS:fileExists(var.levelPath .. "/art/terrains/main.materials.json") then
  if not FS:fileExists(var.levelPath .. matFilePath) then
    if FS:fileExists(var.levelPath .. "/art/terrains/main.materials.json") then
      matFilePath = "/art/terrains/main.materials.json"
      terrainFolder = "/art/terrains/"
    elseif FS:fileExists(var.levelPath .. "/art/terrains/materials.json") then
      editor.logWarn("Deperecated Terrain Material file.")
@/lua/ge/extensions/editor/assetManagementTool.lua
      if isTargetPathValid(asset.targetPath) then
        if FS:fileExists(asset.targetPath) then
          editor.logWarn("Asset file already exists, skipping: " .. asset.targetPath)
      if json["path"] then
        if not FS:fileExists(json["path"]) then
          editor.logError("Invalid link path for: " .. filename .. " --> " .. json["path"])
@/lua/ge/extensions/gameplay/city.lua

  if not file or not FS:fileExists(file) then return end
@/lua/ge/extensions/gameplay/traffic/baseRole.lua
function C:setupFlowgraph(fgFile, varData) -- sets up custom flowgraph logic for this vehicle to use
  if not FS:fileExists(fgFile or '') then
    log('E', 'traffic', 'Flowgraph file not found: '..dumps(fgFile))
@/lua/ge/extensions/editor/flowgraph/main.lua
          for idx, file in ipairs(recentFiles) do
            if FS:fileExists(file) then
              if im.MenuItem1(idx.." - " .. file) then
@/lua/console/test.lua
            if string.find(file, ".jbeam") and not string.find(file, ".jbeamc") then
                if FS:fileExists(directory.."/"..file) then
                    table.insert(jbeamFiles, directory.."/"..file)
@/lua/ge/extensions/editor/crawlEditor.lua

  if FS:fileExists(newFilePath) then
    dump('[CRAWL_EDITOR] Cannot rename: target file already exists: ' .. newFilePath)

            if FS:fileExists(trailFile) then
              local trail = gameplay_crawl_saveSystem.getTrailById(trailFile)

            if FS:fileExists(pathFile) then
              local path = gameplay_crawl_saveSystem.getPathById(pathFile)

            if FS:fileExists(boundaryFile) then
              local boundary = gameplay_crawl_saveSystem.getBoundaryById(boundaryFile)
  local newTrailFile = missionDir .. missionName .. ".trail.json"
  if FS:fileExists(newTrailFile) then
    log('E', 'crawl_editor', 'Trail file already exists in mission: ' .. newTrailFile)
  local newTrailFile = levelCrawlDir .. trail._fileName .. ".trail.json"
  if FS:fileExists(newTrailFile) then
    log('E', 'crawl_editor', 'Trail file already exists in level: ' .. newTrailFile)
          if selectedTrail then
            if selectedTrail._filePath and FS:fileExists(selectedTrail._filePath) then
              FS:removeFile(selectedTrail._filePath)
@/lua/ge/extensions/editor/assetBrowser.lua
  -- modified since the last cache creation.
  if FS:fileExists(job.args[1].inspectorData.cachePath) == false
  or (FS:fileExists(job.args[1].inspectorData.cachePath) == true and job.args[1].filestats.modtime > FS:stat(job.args[1].inspectorData.cachePath).createtime) then
  if FS:fileExists(job.args[1].inspectorData.cachePath) == false
  or (FS:fileExists(job.args[1].inspectorData.cachePath) == true and job.args[1].filestats.modtime > FS:stat(job.args[1].inspectorData.cachePath).createtime) then
    local shapePrev = ShapePreview()
  -- modified since the last cache creation.
  if FS:fileExists(asset.inspectorData.cachePath) == false
  or (FS:fileExists(asset.inspectorData.cachePath) == true and asset.filestats.modtime > FS:stat(asset.inspectorData.cachePath).createtime) then
  if FS:fileExists(asset.inspectorData.cachePath) == false
  or (FS:fileExists(asset.inspectorData.cachePath) == true and asset.filestats.modtime > FS:stat(asset.inspectorData.cachePath).createtime) then
    local shapePrev = ShapePreview()
          local path = "/temp/assetBrowser/thumbnails" .. file.path .. ".png"
          if file.type == "mesh" and FS:fileExists(path) then
            FS:removeFile(path)
        local cachePath = "/temp/assetBrowser/thumbnails" .. asset.path .. ".png"
        if(FS:fileExists(cachePath)) then
          FS:removeFile(cachePath)
@/lua/ge/extensions/gameplay/missions/missions.lua
    local luaPath = reqPath..".lua"
    if not FS:fileExists(luaPath) then
      log("E", "", "Unable to load mission type, file not found: "..dumps(luaPath))

    if FS:fileExists(reqPath) then
      missionProgressSetupData[missionTypeName] = jsonReadFile(reqPath)

    if FS:fileExists(reqPath) then
      missionStaticData[missionTypeName] = jsonReadFile(reqPath)
    local luaPath = reqPath..".lua"
    if not FS:fileExists(luaPath) then
      log("W", "", "found no editor for mission type " .. missionTypeName ..": "..dumps(luaPath))
  for _, fn in ipairs(previewFilenames) do
    if FS:fileExists(missionData.missionFolder..fn) then
      return missionData.missionFolder..fn
      return missionData.missionFolder..fn
    elseif FS:fileExists(missionTypesDir.."/"..missionData.missionType.."/"..fn) then
      return missionTypesDir.."/"..missionData.missionType.."/"..fn
  for _, fn in ipairs(thumbFilenames) do
    if FS:fileExists(missionData.missionFolder..fn) then
      return missionData.missionFolder..fn
      return missionData.missionFolder..fn
    elseif FS:fileExists(missionTypesDir.."/"..missionData.missionType.."/"..fn) then
      return missionTypesDir.."/"..missionData.missionType.."/"..fn
  local infoPath = missionDir .. "/" .. infoFile
  if not FS:fileExists(infoPath) then
    log("E", "", "Unable to load mission, info file not found: "..dumps(infoPath))
      local customPath = mission.missionFolder.."/constructor" -- constructor specific to this mission
      if FS:fileExists(customPath..".lua") then
        local result, err = xpcall(function()
@/lua/ge/extensions/gameplay/rally/notebook/missionSettings.lua
  -- create the mission settings file if it doesnt exist
  if not FS:fileExists(self:fname()) then
    -- log('D', logTag, "mission settings file not found: "..self:fname())
  local notebookFname = rallyUtil.getNotebookFullPath(self.missionDir, newMissionSettingsData.notebook.filename)
  if not newMissionSettingsData.notebook.filename or not FS:fileExists(notebookFname) then
    -- log('D', logTag, 'missionSetting for notebook.filename not found in mission settings file at '..tostring(self:fname()))
  -- check if the notebook file exists
  if not FS:fileExists(self:fname()) then
    -- log('D', logTag, 'notebook.filename setting not found: ' .. tostring(newMissionSettingsData.notebook.filename))
@/lua/ge/extensions/editor/dynamicDecals/export.lua
    local path = string.format("%s%s%s.%s", dirPath, texturesExport_Name, v, exportTexturesFileTypes[texturesExport_exportFormatId])
    table.insert(texturesExport_exportPaths, {path, FS:fileExists(path)})
  end
@/lua/ge/extensions/gameplay/rally/notebook/structured/textCompositor.lua
function C:load()
  if FS:fileExists(self:compositorPath()..'.lua') then
    self.compositor = self:_requireCompositor()

      local file_exists = FS:fileExists(pacenoteFname)
      if not file_exists then
@/lua/ge/extensions/editor/missionEditor/prefabs.lua
    local file = self.mission.prefabs[i]
    local foundFile = file ~= "" and FS:fileExists(file)
    if foundFile then
@/lua/ge/extensions/flowgraph/modules/fileModule.lua
    self.mgr:logEvent("Loading file " .. file,"I", "File " .. p .. " has been loaded.")
    if FS:fileExists(p) then
      self.files[file] = jsonReadFile(p) or deepcopy(defaultFile)
@/lua/ge/extensions/core/hardwareinfo.lua
  local originalSize = -1
  if FS:fileExists("integrity.json") then
    local manifest = jsonReadFile("integrity.json")
  log('D', 'hardwareinfo.onBananaBenchReady', 'onBananaBenchReady: ' .. tostring(outFilename))
  if not FS:fileExists(outFilename) then
    guihooks.trigger('BananaBenchReady', nil)
local function latestBenchmarkExists()
  return FS:fileExists('bananabench.json')
end
@/lua/ge/extensions/scenario/scenarios.lua
        local moduleFullPath = scenario.directory.."/"..e.name
        if FS:fileExists(moduleFullPath.. '.lua') then
          local m
@/lua/ge/server/server.lua
  -- Load up any core datablocks
  if FS:fileExists("core/art/datablocks/datablockExec.cs") then
    TorqueScriptLua.exec("core/art/datablocks/datablockExec.cs")
  loadingProgress:update(-1, '')
  if FS:fileExists("art/decals/managedDecalData.cs") then
    TorqueScriptLua.exec("art/decals/managedDecalData.cs")
  loadingProgress:update(-1, '')
  if FS:fileExists("art/datablocks/player.datablocks.json") then
    loadJsonMaterialsFile("art/datablocks/player.datablocks.json")
    local json_main = path.getPathLevelMain(levelName)
    if FS:fileExists(json_main) then
      Sim.deserializeObjectsFromFile(json_main, true)
      -- Make sure the level exists
      if not FS:fileExists(levelPath) then
        log('E', 'levelLoading', "Could not find level: "..levelPath)
  -- Load the static level decals.
  if FS:fileExists(levelDir.."main.decals.json") then
    be:decalManagerLoad(levelDir.."main.decals.json", ldgCtx)
    be:decalManagerLoad(levelDir.."main.decals.json", ldgCtx)
  elseif FS:fileExists(levelDir.."../main.decals.json") then
    be:decalManagerLoad(levelDir.."../main.decals.json", ldgCtx)
@/lua/ge/extensions/ui/liveryEditor/userData.lua
  local filePath = saveDir .. filename .. dynDecalsExtension
  return FS:fileExists(filePath)
end

  if not FS:fileExists(filePath) then
    log("W", "", "File " .. (filename or "nil") .. " not found")

  if not FS:fileExists(filePath) then
    log("W", "", "File " .. (filename or "nil") .. " not found")
@/lua/ge/extensions/career/modules/linearTutorial.lua

  if not FS:fileExists("/gameplay/tutorials/pages/"..id.."/content.html") then return end
@/lua/ge/extensions/freeroam/facilities.lua
  for _, p in ipairs(path) do
    if FS:fileExists(p) then return p end
  end
local function parseFacilitiyFile(file, facilities, levelDir)
  if not FS:fileExists(file) then return end
  local fileDir, fn, _ = path.split(file, true)
@/lua/ge/extensions/editor/crawlEditor/missionPortTool.lua

  if not FS:fileExists(boundsFile) then
    log('E', logTag,"bounds.sites.json not found in: " .. missionDir)

  if not FS:fileExists(raceFile) then
    log('E', logTag,"race.race.json not found in: " .. missionDir)

  if not FS:fileExists(infoFile) then
    log('W', logTag,"info.json not found in: " .. missionDir .. " (start position will not be available)")

        if FS:fileExists(boundsFile) and FS:fileExists(raceFile) then
          table.insert(missionsList, {

        if FS:fileExists(boundsFile) and FS:fileExists(raceFile) then
          table.insert(missionsList, {
          local trailFile = missionDir .. "/" .. missionName .. ".trail.json"
          if FS:fileExists(trailFile) then
            portedMissions[missionName] = true

            if FS:fileExists(boundsFile) and FS:fileExists(raceFile) then
              -- Port all missions without checking if already ported

            if FS:fileExists(boundsFile) and FS:fileExists(raceFile) then
              -- Port all missions without checking if already ported
@/lua/ge/extensions/editor/rallyEditor/measurementsTab.lua

  if not FS:fileExists(filePath) then
    log('D', logTag, 'No measurements file found at: ' .. filePath)
@/lua/common/settings.lua
if not shipping_build then
   if FS:fileExists(M.pathInternal) then
    local internalValues = jsonReadFile(M.pathInternal) or {}
@/lua/ge/extensions/scenario/scenariosLoader.lua

        if not FS:fileExists(scenarioData.mission) then
          -- Fallback to old MIS file

        if not FS:fileExists(scenarioData.mission) then
          -- Fallback to level directory
    local tmp = '/levels/' .. scenarioData.levelName .. '/info.json'
    if FS:fileExists(tmp) then
      local infoJson = jsonReadFile(tmp)
    end
    if scenarioData.directory and not FS:fileExists(scenarioData.directory.."/"..scenarioData.startHTML) then
      if not htmldiscovered then
      local absolutePath = fgPath
      local path = FS:fileExists(relativePath) and relativePath or (FS:fileExists(absolutePath) and absolutePath or nil)
      if not path then
      local absolutePath = fgPath
      local path = FS:fileExists(relativePath) and relativePath or (FS:fileExists(absolutePath) and absolutePath or nil)
      if not path then
  end
  if not FS:fileExists(path) then
    log('E', logTag, path .." does not exist")
@/lua/vehicle/controller/vehicleController/vehicleController.lua
  local controlLogicModulePath = controlLogicModuleDirectory .. controlLogicName
  if not FS:fileExists("lua/vehicle/" .. controlLogicModulePath .. ".lua") then
    local controlLogicModuleDirectoryLegacy = "controller/shiftLogic-"
@/lua/ge/extensions/gameplay/rally/settingsManager.lua
--   local settingsFname = rallyUtil.getMissionSettingsFile(md)
--   if not FS:fileExists(settingsFname) then
--     log('I', logTag, 'creating mission.settings.json at '..settingsFname)
@/lua/ge/extensions/ui/apps.lua
    local origLayout = jsonReadFile(originalFilePath)
    if FS:fileExists(userFilePath) then
      local userLayout = jsonReadFile(userFilePath)
    local originalFilePath = data.filename:gsub(layoutPath, originalLayoutPath)
    if FS:fileExists(originalFilePath) then
      local originalLayout = jsonReadFile(originalFilePath)
@/lua/common/json-ast.lua
  end
  --if FS:fileExists(filename .. '.ast.json') then
  --  FS:removeFile(filename .. '.ast.json')
  --end
  --if FS:fileExists(filename .. '_') then
  --  FS:removeFile(filename .. '_')
@/lua/ge/extensions/gameplay/rally/transcripts/path.lua

  if not FS:fileExists(self.fname) then
    log('W', logTag, 'load: transcript fname doesnt exist')
@/lua/ge/extensions/util/export.lua
  local filepathIn = filepath
  if not FS:fileExists(filepath) then
    if filepath:sub(1, 1) == '@' then
    filepath = '/temp/' .. filepath .. '.png'
    if not FS:fileExists(filepath) then
      if not convertDDSToPNG(filepathIn, filepath) then
    end
    if not FS:fileExists(fn) then
      break
@/lua/ge/extensions/gameplay/drag/saveSystem.lua
  -- Hash the config file
  if FS:fileExists(configFile) then
    local hash = FS:hashFile(configFile)
@/lua/ge/ge_utils.lua
    opt.config = 'vehicles/' .. modelName .. '/' .. model.model.default_pc .. '.pc'
  elseif type(opt.config) == 'string' and not string.find(opt.config, '.pc') and FS:fileExists('/vehicles/' .. modelName .. '/' .. opt.config .. '.pc') then
    opt.config = 'vehicles/' .. modelName .. '/' .. opt.config .. '.pc'
function imageExistsDefault(path, fallbackPath)
  if path ~= nil and FS:fileExists(path) then
    return path
function fileExistsOrNil(path)
  if type(path) == 'string' and FS:fileExists(path) then
    return path
  for _,v in pairs(files) do
    if FS:directoryExists(v) and not FS:fileExists(v) then
      table.insert(dirs, v)
@/lua/common/extensions.lua
    if not file then break end
    if FS:fileExists(file) then
      -- loading at a root "" which signifies "global space", maintains backwards compatibility with the old
@/lua/ge/extensions/gameplay/missions/missionTypes/flowMission.lua
  if exists == nil then
    exists = FS:fileExists(self.defaultPreviewFile)
    defaultPreviewCache[self.defaultPreviewFile] = exists
  local absolutePath = fgFile
  local path = FS:fileExists(relativePath) and relativePath or (FS:fileExists(absolutePath) and absolutePath or nil)
  if not path then
  local absolutePath = fgFile
  local path = FS:fileExists(relativePath) and relativePath or (FS:fileExists(absolutePath) and absolutePath or nil)
  if not path then
@/lua/ge/extensions/gameplay/missions/missionManager.lua
  local scriptPath = mission.missionFolder.."/script"
  if FS:fileExists(scriptPath..".lua") then
    local script
          model, config = vehicleInstance.model, vehicleInstance.configPath
          if vehicleInstance.customConfigPath and FS:fileExists(vehicleInstance.customConfigPath) then
            config = vehicleInstance.customConfigPath
@/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
    l.infoPath = d .. '/info.json'
    if not FS:fileExists(l.infoPath) then
      log('W', '', 'info.json missing: ' .. l.infoPath)
      l.fullfilename = newSceneTreeEntry
    elseif FS:fileExists(oldMainFile) then
      l.fullfilename = oldMainFile

  if  FS:fileExists(missionFile) then
    return missionFile

    if FS:fileExists(newMission) then
      return newMission

    if FS:fileExists(newMission) then
      return newMission

  if FS:fileExists(missionFile..'.mis') then
    return missionFile..'.mis'
  -- check if new format
  if levelPath:find('main.level.json') and not FS:fileExists(levelPath) then
    local newName = levelPath:sub(0, levelPath:find('main.level.json') - 1)