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