Topics
All
Mac OS X
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Guides
Examples
New in version:
8.2
8.3
8.4
8.5
9.0
9.1
9.2
9.3
9.4
9.5
Statistic
Files.MoveToTrash
Deletes an item by moving it to trash without user interface.
Component | Version | macOS | Windows | Server | FileMaker Cloud | FileMaker iOS SDK |
Files | 2.8 | Yes | Yes | Yes | Yes | Yes |
Parameters
Parameter | Description | Example value |
---|---|---|
Path | The native file path to the file or folder to be deleted. | "/Users/John/Desktop/test.txt" |
Result
Returns OK or error message.
Description
Deletes 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.
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
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)
See also
Example Databases
Blog Entries
- Adobe PDFViewer crashes in FileMaker
- MBS FileMaker Plugin, version 5.3pr1
- MBS Filemaker Plugin, version 2.8pr1
Created 18th August 2014, last changed 23th November 2019
Files.MoveFile - Files.ReadFile
Feedback: Report problem or ask question.

Links
MBS FileMaker Plugins