Lua:deleteFile

From Cheat Engine
Revision as of 19:55, 25 June 2026 by Leunsel (talk | contribs) (Syntax Highlighting.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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[edit]

Parameter Type Description
pathtofile String The path to the file to delete.

Returns[edit]

boolean — True if a file existed at the specified path and no longer exists after the call, otherwise false.

Examples[edit]

1 local path = "C:\\\\Temp\\\\example.txt"
2 
3 if deleteFile(path) then
4   print("File deleted")
5 else
6   print("File was not deleted")
7 end

See Also[edit]

Main Pages