Command RENAME Foundation
Changes the name of a file.
RENAME <cOldName> TO <cNewName>
The file command RENAME renames a file. The file is renamed only when <cOldFile> and <cNewFile> contain valid file names. If the operation fails, the file error can be determined using the error code returned by the function FError().
The command does not consider either the PATH setting or the path specified with DEFAULT. <cOldName> and <cNewName> must be complete file names including the drive and path. When the file name does not contain drive or path, the current directory is searched for <cOldName>.
If the original directory is not the same as the target directory, the file is moved to the target directory. If a file already exists with the file name <cNewName>, RENAME fails.
The functional equivalent of the command RENAME is the function FRename().
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.