rename

rename(newname: String);

The rename method of the File class changes the name of the file associated with the file object to the value specified in the newname parameter.

An open file is closed before it is renamed.

This method does not change the value of the FileNode class fileName property.

The code fragment in the following example shows the use of the rename method.

myfile.rename(path & "changes.log");

Jade attempts to rename files across devices. This attempt could fail for various reasons (often related to an operating system restriction), as follows.