I am writing an application that will delete files. If the volume supports the Trash folder, I want to move the files there, otherwise just delete them.
It may only be my search for mojo, putting up with me, but I cannot find how to do it.
The goal here is to do something like (pseudocode):
if (itemURL on volume that supports Trash) use trashItemAtURL:resultingItemURL:error: else use removeItemAtURL:error:
I am aware of recycleURLs: completHandler: but, for example, for SMB volumes, it places a dialog about how files (files) will be deleted immediately. And I would like to process the files individually to update the display. I suggest that I could use recycleURLs: completeHandler: if file system events work on SMB volumes, but I'm not sure if they do.
Anyhoo .. Is there some kind of API I'm missing out on, or some recommended method that I just can't find?
source share