Skip to content

delfile

delfile deletes the file at the specified path if it exists.

This is useful for cleaning up temporary data or removing no-longer-needed files at runtime.

function delfile(path: string): ()

Parameters

Parameter Description
path The path of the file to delete.

Example

Deleting a file
1
2
3
4
writefile("file5.txt", "Hello")
print(isfile("file5.txt")) -- Output: true
delfile("file5.txt")
print(isfile("file5.txt")) -- Output: false