From MiniScript Wiki
Jump to navigation Jump to search

The file.delete method deletes a file or empty directory from disk.


Parameter Name Default Value Meaning
path "" file name, partial path, or absolute path to file or directory to be deleted

If given a file name or partial path, it will be interpreted relative to the current working directory (see file.curdir).


If the file was successfully deleted, this method returns true (1). Otherwise, it returns false (0). This can happen if the specified file does not exist, if it is a directory that is not empty, or if some other low-level issue occurs (for example, the file is locked).

Known Issue

In version 1.0 of Mini Micro, file.delete fails on a directory (even if empty), returning "Error: file not found".


The following attempts to delete a file called "test.txt" in the current directory.

file.delete "test.txt"