1) Errors on file deletion are not reported in DeleteFileCommand, the return value from send2trash is ignored making it hard to see what happens. Handling the errors like DeleteFolderCommand does could make sense.
2) File deletion on filesystems without a trash folder is not supported.
send2trash ends up calling FSMoveObjectToTrashSync from CoreServices. The function returns an errors and does not remove the file on filesystems without a trash can. OSXFuse (3.2.0) sshfs is an example of such a filesystem, but in general this is the case for most fuse filesystems.
Finder handles errors from FSMoveObjectToTrashSync and then asks the user and deletes the file upon user confirmation. Doing likewise might be a solution.
This might be two issues:
1) Errors on file deletion are not reported in
DeleteFileCommand
, the return value from send2trash is ignored making it hard to see what happens. Handling the errors likeDeleteFolderCommand
does could make sense.2) File deletion on filesystems without a trash folder is not supported.
send2trash
ends up callingFSMoveObjectToTrashSync
from CoreServices. The function returns an errors and does not remove the file on filesystems without a trash can. OSXFuse (3.2.0) sshfs is an example of such a filesystem, but in general this is the case for most fuse filesystems.Finder handles errors from
FSMoveObjectToTrashSync
and then asks the user and deletes the file upon user confirmation. Doing likewise might be a solution.Tested with Sublime Text build 3103.