rename | ||||||||||
Type | command | |||||||||
Dictionary | LCS | |||||||||
Library | LiveCode Script | |||||||||
Syntax |
| |||||||||
Summary | Gives a file or folder a new name or moves it to a new location or both. | |||||||||
Introduced | 1.0 | |||||||||
Changes | 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. | |||||||||
OS | mac, windows, linux, ios, android | |||||||||
Platforms | desktop, server, mobile | |||||||||
Parameters |
| |||||||||
Example |
| |||||||||
Related | Keyword: file Property: fileType Command: revCopyFile, create alias Function: tempName, files, folders Glossary: command, file, folder Object: stack | |||||||||
Description | Use the rename command to change the name or location of a 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.
*Cross-platform note:* On Windows, if a file with the same file path as newPath already exists then the rename operation will fail. On other platforms, the existing file may be overwritten. If the operation does fail, then the result will be "can't rename file". Note that a rename operation may fail on any operating system, so it's important to check the result afterwards. | |||||||||
Tags | file system |