Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
12.2
12.3
12.4
12.5
13.0
13.1
13.2
13.3
13.4
13.5
Statistic
FMM
Blog
Files.RenameFile
Renames a file or folder without user interface.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Files | 2.8 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameters
Parameter | Description | Example |
---|---|---|
Path | The native path to the file or folder to be renamed. | "/Users/John/Desktop/test.txt" |
NewName | The new name. | "testfile.txt" |
Result
Returns OK or error message.
Description
Renames a file or folder without user interface.Path must be valid and exist.
This function requires a native path. Use Path.FileMakerPathToNativePath to convert a FileMaker path to a native path if required. If you like to have the user choose the path, you can use FileDialog functions.
For Server be aware that server has limited permissions and may not be able to access all files on a computer.
Examples
Rename file on Windows with full path:
MBS( "Files.RenameFile"; "\\FileServer\Dokumente\VK\123456\RG249388345.pdf" ; "\\FileServer\Dokumente\VK\123456\Rechnung_249388345.pdf" )
Rename file on OS X:
MBS( "Files.RenameFile"; "/Users/cs/Desktop/test"; "Hello World, just a test!" )
Rename on Windows:
MBS( "Files.RenameFile"; "C:\Users\Administrator\Desktop\alt.fmp12"; "neu.fmp12")
See also
Release notes
- Version 8.2
- Fixed a rare problem on Mac with Files.RenameFile.
- Rewrote Files.RenameFile for Mac.
- Version 7.4
- Changed Files.RenameFile to accept only file name as second parameter instead of file path for Windows. That was inconsistent to the Mac behavior where the name was enough.
Blog Entries
- FileMaker 18 File Script Steps vs. BinaryFile functions
- MBS FileMaker Plugin, version 8.2pr4
- MBS FileMaker Plugin, version 8.2pr3
- MBS FileMaker Plugin, version 7.4pr2
- MBS Filemaker Plugin, version 2.8pr8
This function checks for a license.
Created 18th August 2014, last changed 5th August 2017
