Error getting tags :
error 404Error getting tags :
error 404 rename | revDocs | RunRev
Welcome Guest (Log in)
Product Edition
Expander triangle
rename [file | folder |directory] filePath to newPath
Desktop, Web and Server
Platform Support
MacOS,Mac OS X,Windows,Linux
None required
Gives a file or folder a new name or moves it to a new location or both.

rename file "Foo.txt" to "Bar.txt"
rename folder "/bin/utilities/help" to "/public/utilities/new-help"

Additional Comments
Expander triangle

Use the rename command to change the name or location of a file or folder.


The filePath specifies the current name and location of the file or folder you want to rename or move. If you specify a name but not a location, Revolution assumes the file or folder is in the defaultFolder.

The newPath specifies the new name and location of the file or folder.


The rename command can be used to change a file's or folder's location only if the old and new locations are both on the same volume.

Caution! This command can be used to rename or move files and folders your stack did not create. Of course, a stack should not rename or move files and folders it didn't create without obtaining explicit confirmation from the user.

Changes to Revolution:

The ability to move a file or folder on Mac OS and Windows systems with the rename command was introduced in version 1.1.1. In previous versions, the rename command could be used only to change the name, not the location.

User Comments
Expander triangle
User thumbnail
Peter Brigham
Nov 7, 2009
With the command
rename file oldFIlePath to newFilePath
if there is already a file newFilePath, the original file will be overwritten and replaced by the file that is being moved or renamed, and there will be no alert displayed. If this is likely to create a problem, you should check first with something like:
if there is a file newFilePath then answer "Replace the existing file with the new one?" with "yes" or "no" if it is "no" then exit to top end if rename file oldFIlePath to newFilePath