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:
9.3
9.4
9.5
10.0
10.1
10.2
10.3
10.4
10.5
10.6
Statistic
FMM
Blog
Files.DeleteFolder
Deletes a file or folder directly without moving to trash.
| Component | Version | macOS | Windows | Linux | Server | FileMaker iOS SDK |
| Files | 4.2 | Yes | Yes | Yes | Yes | Yes |
Parameters
| Parameter | Description | Example |
|---|---|---|
| Path | The native folder path to the item to be deleted. | "/Users/John/Desktop/test" |
Result
Returns OK or error message.
Description
Deletes a file or folder directly without moving to trash.Use Files.MoveToTrash to move files to trash which is often better as it allows users to undo the operation. Also Files.MoveToTrash usually works on files in use.
It is possible that the OS decides to not delete the file and fail (e.g. due to permission errors).
Folders are deleted recursively.
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 folder on desktop on Mac:
$r = MBS("Files.Delete"; "/Users/cs/Desktop/testing")
Delete a folder on desktop on Windows:
$r = MBS("Files.Delete"; "C:\Users\Christian\Desktop\testing")
See also
Blog Entries
FileMaker Magazin
Created 18th August 2014, last changed 12nd August 2015
Files.Delete - Files.DirectoryExists
Feedback: Report problem or ask question.
Links
MBS Xojo tutorial videos