See Also: File I/O Commands, CopyFile, Direct_Input, EraseFile
To change the name of a disk file.
RenameFile {old-filename} to {new-filename}
where:
{old-filename} may contain a folder path
{new-filename} may not contain a folder path
RenameFile changes the name of a disk file. After renaming, the new file will appear in the same folder that the old file was in.
This sample renames file "vendor.txt" in the "C:\MyProject\Text Files" folder to "seller.txt".
RenameFile "C:\MyProject\Text Files\vendor.txt" to "seller.txt"
You may use "wild-card" (ambiguous) filenames with RenameFile provided your operating system supports such usage in its rename function.
If RenameFile is executed on a non-existent {old-filename}, no error will be triggered, and no file will be affected in any way.
If {new-filename} already exists, no error will be triggered and no file will be affected in any way. Use File_Exist to check whether file already exists.
If {new-filename} contains a path, no error will be triggered and no file will be affected in any way.
When a DFPATH is in effect: If {old-filename} contains no folder name, the first path in DFPATH will be used.