Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.0   6.1   6.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3    Statistic  

Files.MoveToTrash

Deletes the file 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

MBS( "Files.MoveToTrash"; Path )

Parameters

Parameter Description Example value
Path The native file path to the file to be deleted. "/Users/John/Desktop/test.txt"

Result

Returns OK or error message.

Description

Deletes the file by moving it to trash without user interface.
This function needs a native path. Please use Path.FileMakerPathToNativePath function in order to convert a FileMaker style path to a native path.
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.

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

See also

Example Databases


Files.MoveFile   -   Files.ReadFile

Feedback: Report problem or ask question.




Links
MBS Xojo Chart Plugins