delete file in lua script

Is there any way of deleting files from a lua script? I mean, just removing from hard disk, without touching the database.
I don’t find anything like this in lua documentation: there is copy, move but no delete.
Thanks.

os.execute("rm <path and filename>")

replace rm with del if on windows

2 Likes

Should not be more portable: os.remove(<path and filename>) ?

Disclaimer: not tested

2 Likes

That should work too, though the documentation says on POSIX systems, and I don’t believe that Windows is POSIX and I’m not sure what OS they are on. But now they have options :grin:

2 Likes