Platforms to show: All Mac Windows Linux Cross-Platform

Back to FolderItem class.

FolderItem.MacMoveObjectToTrashMBS(byref Result as folderitem, Options as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS MacClassic Plugin 9.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
This routine will move the source object into the trash.

The source object can be a file or directory. If the volume the source object resides on does not support a trash folder then this call will return an error (this is the same circumstance that triggers the delete immediately behavior in the Finder).

self: The source object to move to the trash.
result: Upon successful completion a ref the object in the trash. If source is a directory then target will be the corresponding object in the destination directory.
options: One or more FSFileOperation flags

Requires Mac OS X 10.5.

Use this constants:
kFSFileOperationDefaultOptions0Use the default options - no overwrite, fail if any source item cannot be read, cross volume moves OK.
kFSFileOperationOverwrite1Replace an item in the destDir that has the same name as an item being moved/copied there.
kFSFileOperationSkipSourcePermissionErrors2Skip items that cannot be read and continue copying/moving instead of failing the operation.
kFSFileOperationDoNotMoveAcrossVolumes4Do not perform a copy/delete to move an item across volume boundries - fail the operation instead.
kFSFileOperationSkipPreflight8Skip the preflight for a directory move/copy. This will limit the status information that can be returned since the totals will not be calculated.

Returns a Mac OS error code. Error code -1 is from the plugin for invalid parameters or the function not being availanle.

Some examples using this method:

Blog Entries

The items on this page are in the following plugins: MBS MacClassic Plugin.


The biggest plugin in space...