os.remove

Deletes a file

Prototype

ok, message = os.remove (filename)

Description

Deletes the file. On success, returns true.

If it cannot, it returns nil followed by an error message.

os.remove ("test.txt") --> true
ok, err = os.remove ("test.txt") --> nil, test.txt: No such file or directory

Lua functions

Topics