-
-
Notifications
You must be signed in to change notification settings - Fork 5
FileExists
Anthony Headley edited this page Apr 21, 2020
·
2 revisions
Takes a full file path and returns true if the file exists and false if not.
Name | Description | Optional |
---|---|---|
string: filename | Full path of the file to check |
bool : true = file exists bool : false = file does not exist
local sep = GetPathSeparator()
-- navigate to the demoshows path
local path = Root().Temp.DriveCollect[1].path .. sep .. ".." .. sep .. "demoshows"
-- build two shows files to look for
local files = {}
files[1] = path .. sep .. "Demoshow_Fullsize_and_Light.show"
files[2] = path .. sep .. "randomfilename.random"
-- loop through the above files and echo the result of the file
for key, value in pairs(files) do
if FileExists(value) then
Echo(value .. " - Exists")
else
Echo(value .. " - Does not exist")
end
end