Instance Method

fileManager:shouldCopyItemAtPath:toPath:

Asks the delegate if the file manager should copy the specified item to the new path.

Declaration

- (BOOL)fileManager:(NSFileManager *)fileManager shouldCopyItemAtPath:(NSString *)srcPath toPath:(NSString *)dstPath;

Parameters

fileManager

The file manager object that is attempting to copy the file or directory.

srcPath

The path to the file or directory that the file manager wants to copy.

dstPath

The new path for the copied file or directory.

Return Value

YES if the item should be copied or NO if the file manager should stop copying items associated with the current operation. If you do not implement this method, the file manager assumes a response of YES.

Discussion

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 macOS 10.6 and later.

See Also

Copying an Item

- fileManager:shouldCopyItemAtURL:toURL:

Asks the delegate if the file manager should copy the specified item to the new URL.

- 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:copyingItemAtPath:toPath:

Asks the delegate if the move operation should continue after an error occurs while copying the item at the specified path.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software