removefile

The removefile command is used to delete files.

When a file is no longer needed, use the removefile command to delete the file. It is necessary to use the full path of the file. The syntax is as follows:

removefile("filename");

Options

The removefile command does not take any options.

Example

In the following example, we will use removefile to delete the sample file we used in the other examples on file operations. The code would be as follows:

removefile("file2.txt");

The file is now deleted.