Skip to main content

remove

Function remove 

Source
pub fn remove(filename: string) -> option<boolean>
Expand description

Deletes a file.

§Parameters

  • filename: the name of the file (or empty directory, on POSIX systems) to delete.

§Return value

True on success; in case of errors, nil plus an error message and an error code.

§Examples

local ok, err = os.remove("old.log")
if not ok then print("could not remove:", err) end

§See also

rename