Components Crossplatform Mac & Win Server Client Old Deprecated Guides Examples Videos
New in version: 12.0 12.1 12.2 12.3 12.4 12.5 13.0 13.1 13.2 13.3 Statistic FMM Blog
Deletes an item by moving it to trash without user interface.
|Files||2.8||✅ Yes||✅ Yes||✅ Yes||✅ Yes||✅ Yes|
$Path) /* The native file path to the file or folder to be deleted.e.g. "/Users/John/Desktop/test.txt" */ Less
|Path||The native file path to the file or folder to be deleted.||"/Users/John/Desktop/test.txt"|
Returns OK or error message.
DescriptionDeletes an item by moving it to trash without user interface.
Use this functions to move files and folders to the trash.
It is possible that the OS decides to not delete the file and fail (e.g. due to permission errors) or that the medium does not have a trash, so the file is deleted right away.
On Windows you can't delete/move an open file.
If you delete a file in a server script on a macOS server, the item is moved into the /Library/FileMaker Server/.Trash folder.
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.
Delete a file on desktop on Mac by moving it to trash:
$r = MBS("Files.MoveToTrash"; "/Users/cs/Desktop/testing.fp7")
Delete a file on desktop on Windows by moving it to trash:
$r = MBS("Files.MoveToTrash"; "C:\Users\Christian\Desktop\testing.fp7")
Delete a file to trash with path in variable:
$r = MBS("Files.MoveToTrash"; $Path)
- Version 11.1
- Improved error message for Files.MoveToTrash when file to delete is in use.
- MBS FileMaker Plugin, version 11.1pr6
- Adobe PDFViewer crashes in FileMaker
- FileMaker 18 File Script Steps vs. BinaryFile functions
- MBS FileMaker Plugin, version 5.3pr1
- MBS Filemaker Plugin, version 2.8pr1
This function checks for a paid license.
Created 18th August 2014, last changed 9th March 2021