Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   Crossplatform   Server (Not)   Client   Components   Old   Guides
New in version: 4.0   4.1   4.2   4.3   4.4   5.0   5.1   5.2   5.3   5.4   6.0   6.1   6.2   6.3   6.4   6.5   7.0   7.1    Statistic  

Files.RenameFile

Renames a file or folder without user interface.

Component: Files
Version: 2.8
Mac OS X: Yes
Windows: Yes
Server: Yes
FileMaker Cloud: Yes

MBS( "Files.RenameFile"; Path; NewName )

Parameters

Parameter Description Example value
Path The native path to the file or folder to be renamed. "/Users/John/Desktop/test.txt"
NewName The new name. On Windows must be full path to new file. "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 needs a native path. Please use Path.FileMakerPathToNativePath function in order to convert a FileMaker style path to a native path.

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!" )

See also


Files.ReadPNG   -   Files.ResolveBookmark

Feedback: Report problem or ask question.




Links
MBS Realbasic Plugins - Pfarrgemeinde Messdiener Nickenich