File:remove() method

Deletes the file physically on the disk.

Return value

Returns true if the operation succeeded or false otherwise (in case of an opened file for example).

Example

local file = sys.File("text.txt"):open("write") file:writeln("Lorem ipsum") -- output false : file is open and cannot be removed print(file:remove())