Protocol: NSFileManagerDelegate
Overview
The NSFileManagerDelegate protocol defines optional methods for managing operations involving the copying, moving, linking, or removal of files and directories. When you use an NSFileManager object to initiate a copy, move, link, or remove operation, the file manager asks its delegate whether the operation should begin at all and whether it should proceed when an error occurs.Asks the delegate if the file manager should copy the specified item to the new path.Asks the delegate if the file manager should copy the specified item to the new URL.Asks the delegate if a hard link should be created between the items at the two paths. Asks the delegate if a hard link should be created between the items at the two URLs.Asks the delegate if the file manager should move the specified item to the new path.Asks the delegate if the file manager should move the specified item to the new URL. Asks the delegate if the move operation should continue after an error occurs while copying the item at the specified path.Asks the delegate if the move operation should continue after an error occurs while copying the item at the specified URL.Asks the delegate if the operation should continue after an error occurs while linking to the item at the specified path.Asks the delegate if the operation should continue after an error occurs while linking to the item at the specified URL.Asks the delegate if the move operation should continue after an error occurs while moving the item at the specified path.Asks the delegate if the move operation should continue after an error occurs while moving the item at the specified URL. Asks the delegate if the operation should continue after an error occurs while removing the item at the specified path.Asks the delegate if the operation should continue after an error occurs while removing the item at the specified URL.Asks the delegate whether the item at the specified path should be deleted. Asks the delegate whether the item at the specified URL should be deleted.
Instance Method Summary (collapse)
-
- fileManager:shouldCopyItemAtPath:toPath:
Asks the delegate if the file manager should copy the specified item to the new path.
-
- fileManager:shouldCopyItemAtURL:toURL:
Asks the delegate if the file manager should copy the specified item to the new URL.
-
- fileManager:shouldLinkItemAtPath:toPath:
Asks the delegate if a hard link should be created between the items at the two paths.
-
- fileManager:shouldLinkItemAtURL:toURL:
Asks the delegate if a hard link should be created between the items at the two URLs.
-
- fileManager:shouldMoveItemAtPath:toPath:
Asks the delegate if the file manager should move the specified item to the new path.
-
- fileManager:shouldMoveItemAtURL:toURL:
Asks the delegate if the file manager should move the specified item to the new URL.
-
- fileManager:shouldProceedAfterError:copyingItemAtPath:toPath:
Asks the delegate if the move operation should continue after an error occurs while copying the item at the specified path.
-
- fileManager:shouldProceedAfterError:copyingItemAtURL:toURL:
Asks the delegate if the move operation should continue after an error occurs while copying the item at the specified URL.
-
- fileManager:shouldProceedAfterError:linkingItemAtPath:toPath:
Asks the delegate if the operation should continue after an error occurs while linking to the item at the specified path.
-
- fileManager:shouldProceedAfterError:linkingItemAtURL:toURL:
Asks the delegate if the operation should continue after an error occurs while linking to the item at the specified URL.
-
- fileManager:shouldProceedAfterError:movingItemAtPath:toPath:
Asks the delegate if the move operation should continue after an error occurs while moving the item at the specified path.
-
- fileManager:shouldProceedAfterError:movingItemAtURL:toURL:
Asks the delegate if the move operation should continue after an error occurs while moving the item at the specified URL.
-
- fileManager:shouldProceedAfterError:removingItemAtPath:
Asks the delegate if the operation should continue after an error occurs while removing the item at the specified path.
-
- fileManager:shouldProceedAfterError:removingItemAtURL:
Asks the delegate if the operation should continue after an error occurs while removing the item at the specified URL.
-
- fileManager:shouldRemoveItemAtPath:
Asks the delegate whether the item at the specified path should be deleted.
-
- fileManager:shouldRemoveItemAtURL:
Asks the delegate whether the item at the specified URL should be deleted.
Instance Method Details
- (Boolean) fileManager(fileManager, shouldCopyItemAtPath:srcPath, toPath:dstPath)
Asks the delegate if the file manager should copy the specified item to the new path. This method is called once for each item that needs to be copied. Thus, for a directory, this method is called once for the directory and once for each item in the directory.This method performs the same task as the fileManager:shouldCopyItemAtURL:toURL: method, which is preferred over this method in OS X v10.6 and later.
- (Boolean) fileManager(fileManager, shouldCopyItemAtURL:srcURL, toURL:dstURL)
Asks the delegate if the file manager should copy the specified item to the new URL. This method is called once for each item that needs to be copied. Thus, for a directory, this method is called once for the directory and once for each item in the directory.This method performs the same task as the fileManager:shouldCopyItemAtPath:toPath: method and is preferred over that method in OS X v10.6 and later.
- (Boolean) fileManager(fileManager, shouldLinkItemAtPath:srcPath, toPath:dstPath)
Asks the delegate if a hard link should be created between the items at the two paths. If the item specified by destURL is a directory, returning NO prevents links from being created to both the directory and its children.This method performs the same task as the fileManager:shouldLinkItemAtURL:toURL: method, which is preferred over this method in OS X v10.6 and later.
- (Boolean) fileManager(fileManager, shouldLinkItemAtURL:srcURL, toURL:dstURL)
Asks the delegate if a hard link should be created between the items at the two URLs. If the item specified by destURL is a directory, returning NO prevents links from being created to both the directory and its children.This method performs the same task as the fileManager:shouldLinkItemAtPath:toPath: method and is preferred over that method in OS X v10.6 and later.
- (Boolean) fileManager(fileManager, shouldMoveItemAtPath:srcPath, toPath:dstPath)
Asks the delegate if the file manager should move the specified item to the new path. This method is called only once for the item being moved, regardless of whether the item is a file, directory, or symbolic link.This method performs the same task as the fileManager:shouldMoveItemAtURL:toURL: method, which is preferred over this method in OS X v10.6 and later.
- (Boolean) fileManager(fileManager, shouldMoveItemAtURL:srcURL, toURL:dstURL)
Asks the delegate if the file manager should move the specified item to the new URL. This method is called only once for the item being moved, regardless of whether the item is a file, directory, or symbolic link.This method performs the same task as the fileManager:shouldMoveItemAtPath:toPath: method and is preferred over that method in OS X v10.6 and later.
- (Boolean) fileManager(fileManager, shouldProceedAfterError:error, copyingItemAtPath:srcPath, toPath:dstPath)
Asks the delegate if the move operation should continue after an error occurs while copying the item at the specified path. The file manager calls this method when there is a problem copying the item to the specified location. If you return YES, the file manager continues copying any other items and ignores the error.This method performs the same task as the fileManager:shouldProceedAfterError:copyingItemAtURL:toURL: method, which is preferred over this method in OS X v10.6 and later.
- (Boolean) fileManager(fileManager, shouldProceedAfterError:error, copyingItemAtURL:srcURL, toURL:dstURL)
Asks the delegate if the move operation should continue after an error occurs while copying the item at the specified URL. The file manager calls this method when there is a problem copying the item to the specified location. If you return YES, the file manager continues copying any other items and ignores the error.This method performs the same task as the fileManager:shouldProceedAfterError:copyingItemAtPath:toPath: method and is preferred over that method in OS X v10.6 and later.
- (Boolean) fileManager(fileManager, shouldProceedAfterError:error, linkingItemAtPath:srcPath, toPath:dstPath)
Asks the delegate if the operation should continue after an error occurs while linking to the item at the specified path. The file manager calls this method when there is a problem creating a hard link to the item at the specified location. If you return YES, the file manager continues creating any other links associated with the current operation and ignores the error.This method performs the same task as the fileManager:shouldProceedAfterError:linkingItemAtURL:toURL: method, which is preferred over this method in OS X v10.6 and later.
- (Boolean) fileManager(fileManager, shouldProceedAfterError:error, linkingItemAtURL:srcURL, toURL:dstURL)
Asks the delegate if the operation should continue after an error occurs while linking to the item at the specified URL. The file manager calls this method when there is a problem creating a hard link to the item at the specified location. If you return YES, the file manager continues creating any other links associated with the current operation and ignores the error.This method performs the same task as the fileManager:shouldProceedAfterError:linkingItemAtPath:toPath: method and is preferred over that method in OS X v10.6 and later.
- (Boolean) fileManager(fileManager, shouldProceedAfterError:error, movingItemAtPath:srcPath, toPath:dstPath)
Asks the delegate if the move operation should continue after an error occurs while moving the item at the specified path. The file manager calls this method when there is a problem moving the item to the specified location. If you return YES, the file manager proceeds to remove the item from its current location as if the move operation had completed successfully. This method performs the same task as the fileManager:shouldProceedAfterError:movingItemAtURL:toURL: method, which is preferred over this method in OS X v10.6 and later.
- (Boolean) fileManager(fileManager, shouldProceedAfterError:error, movingItemAtURL:srcURL, toURL:dstURL)
Asks the delegate if the move operation should continue after an error occurs while moving the item at the specified URL. The file manager calls this method when there is a problem moving the item to the specified location. If you return YES, the file manager proceeds to remove the item from its current location as if the move operation had completed successfully. This method performs the same task as the fileManager:shouldProceedAfterError:movingItemAtPath:toPath: method and is preferred over that method in OS X v10.6 and later.
- (Boolean) fileManager(fileManager, shouldProceedAfterError:error, removingItemAtPath:path)
Asks the delegate if the operation should continue after an error occurs while removing the item at the specified path. The file manager calls this method when there is a problem deleting the item to the specified location. If you return YES, the file manager continues deleting any remaining items and ignores the error.This method performs the same task as the fileManager:shouldProceedAfterError:removingItemAtURL: method, which is preferred over this method in OS X v10.6 and later.
- (Boolean) fileManager(fileManager, shouldProceedAfterError:error, removingItemAtURL:URL)
Asks the delegate if the operation should continue after an error occurs while removing the item at the specified URL. The file manager calls this method when there is a problem deleting the item to the specified location. If you return YES, the file manager continues deleting any remaining items and ignores the error.This method performs the same task as the fileManager:shouldProceedAfterError:removingItemAtPath: method and is preferred over that method in OS X v10.6 and later.
- (Boolean) fileManager(fileManager, shouldRemoveItemAtPath:path)
Asks the delegate whether the item at the specified path should be deleted. Removed items are deleted immediately and not placed in the Trash. If the specified item is a directory, returning NO prevents both the directory and its children from being deleted. This method performs the same task as the fileManager:shouldRemoveItemAtURL: method, which is preferred over this method in OS X v10.6 and later.
- (Boolean) fileManager(fileManager, shouldRemoveItemAtURL:URL)
Asks the delegate whether the item at the specified URL should be deleted. Removed items are deleted immediately and not placed in the Trash. If the specified item is a directory, returning NO prevents both the directory and its children from being deleted.This method performs the same task as the fileManager:shouldRemoveItemAtPath: method and is preferred over that method in OS X v10.6 and later.