closefile

The closefile command is used to open files.

Once a file has been read, users can apply the closefile command to close the file. The syntax is as follows:

closefile("filename");

Options

The closefile command does not take any options.

Example

In the following example, we will close the file we used in the openfile example. The code would be as follows:

closefile("file2.txt");

The file is now closed for reading or editing.