Contents

fileManager(_:shouldLinkItemAtPath:toPath:)

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

Declaration

optional func fileManager(_ fileManager: FileManager, shouldLinkItemAtPath srcPath: String, toPath dstPath: String) -> Bool

Parameters

  • fileManager:

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

  • srcPath:

    The path or a file or directory that fileManager is about to attempt to link.

  • dstPath:

    The path or a file or directory to which fileManager is about to attempt to link.

Return Value

true if the operation should proceed, otherwise false.

Discussion

If the item specified by destURL is a directory, returning false prevents links from being created to both the directory and its children.

This method performs the same task as the fileManager(_:shouldLinkItemAt:to:) method, which is preferred over this method in macOS 10.6 and later.

See Also

Related Documentation

Linking an Item