Error 66 Directory Not Empty when calling NSFileManager removeItemAtURL:error:

In the event of a unsupported feature error when attempting to trash a user selected file (which occurs if the file is on a external drive), I handle the error by removing the item at the url. Finder seems to do the same thing.


Now sometimes, I get Error 66: Directory Not Empty. I'm not sure what to make of that?

I don't see a constant for this error in FoundationErrors.h. Is there a constant for it?

I'm also sometimes getting NSFileWriteNoPermissionError (rather than code 66). This is strange for my app not to have permissions, especially since my app is the process that created the file in the first place?

Error 66 Directory Not Empty when calling NSFileManager removeItemAtURL:error:
 
 
Q