Deletes the file, link, or directory (including, recursively, all subdirectories, files, and links in the directory) identified by a given path.
- macOS 10.0–10.5Deprecated
- Mac Catalyst 13.0–13.0Deprecated
The path of a file, link, or directory to delete. The value must not be "
." or "
YES if the removal operation is successful. If the operation is not successful, but the handler method
YES, also returns
YES; otherwise returns
This callback mechanism provided by
handler is similar to delegation.
file when it begins a copy, move, remove, or link operation. It sends
file when it encounters any error in processing.
Since the removal of directory contents is so thorough and final, be careful when using this method. If you specify "
." or "
NSInvalid exception is raised. This method does not traverse symbolic links.
Because this method does not return error information, it has been deprecated as of OS X v10.5. Use