Instance Method

fileManager:shouldLinkItemAtURL:toURL:

Asks the delegate if a hard link should be created between the items at the two URLs.

Declaration

- (BOOL)fileManager:(NSFileManager *)fileManager shouldLinkItemAtURL:(NSURL *)srcURL toURL:(NSURL *)dstURL;

Parameters

fileManager

The file manager object that is attempting to create the link.

srcURL

The URL identifying the new hard link to be created.

dstURL

The URL identifying the destination of the link.

Return Value

YES if the link should be created or NO if it should not be created.

Discussion

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

See Also

Linking an Item

- fileManager:shouldLinkItemAtPath:toPath:

Asks the delegate if a hard link should be created between the items at the two paths.

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

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