Renames a file.
•Source file is the path of the file to rename. See Creating file paths.
•New name is a text expression that specifies the new name of the file.
Product | Supported |
FileMaker Pro Advanced | Yes |
FileMaker Go | Yes |
FileMaker WebDirect | No |
FileMaker Server | Yes |
FileMaker Cloud products | Yes |
FileMaker Data API | No |
Custom Web Publishing | Yes |
Runtime solution | No |
FileMaker Pro 18.0 Advanced
Renames the change.log file to change1.log.
Rename File [ Source file: "change.log" ; New name: "change1.log" ]
Adds the current date to the end of the file named change.log if the file exists.
Set Variable [ $file ; Value: "change.log" ]
Get File Exists [ "$file" ; Target: $fileExists ]
If [ $fileExists ]
Rename File [ Source file: "$file" ; New name:
Let ( [
filename = Left ( $file ; Length ( $file ) - 4 ) ;
extension = Right ( $file ; 3 ) ;
date = Get ( CurrentDate ) ;
year = Year ( date ) ;
month = Month ( date ) ;
day = Day ( date )
];
filename & "-" & year & "-" & month & "-" & day & "." & extension
) ]
End If