FileExists - hossimo/GMA3Plugins GitHub Wiki
FileExists(string: filename) : bool
Brief:
Takes a full file path and returns true if the file exists and false if not.
Paramiters:
Name | Description | Optional |
---|---|---|
string: filename | Full path of the file to check |
Returns:
bool : true = file exists bool : false = file does not exist
Examples:
local path = GetPath(26) -- gets the demo shows filder
-- 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