Lua:fileExists
Jump to navigation
Jump to search
<> Reference
function fileExists(pathtofile) : boolean
Returns true if a file exists at the specified path.
Function Parameters
| Parameter | Type | Description |
|---|---|---|
| pathtofile | String | The path to the file to check. |
Returns
boolean — True if a file exists at the specified path, otherwise false.
Examples
local path = "C:\\\\Temp\\\\example.txt"
if fileExists(path) then
print("File exists")
else
print("File does not exist")
end
See Also
Main Pages