isfile
Returns whether a path points to a file.
function isfile(path: string): booleanSynopsis
How it works
Checks whether a file exists at the given path within the workspace directory. Internally calls
GetFileAttributesA(path) and verifies the result is not INVALID_FILE_ATTRIBUTES and does not have the FILE_ATTRIBUTE_DIRECTORY flag. Returns false for directories.Usage
Conditional read
if isfile("config.json") then
local cfg = readfile("config.json")
endParameters
path string Path to check.
Returns
boolean true if a file exists at path.