<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.6.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/FileManagerDelegate/fileManager(_:shouldProceedAfterError:linkingItemAt:to:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(pl)NSFileManagerDelegate(im)fileManager:shouldProceedAfterError:linkingItemAtURL:toURL:"
  },
  "title" : "fileManager(_:shouldProceedAfterError:linkingItemAt:to:)"
}
-->

# fileManager(_:shouldProceedAfterError:linkingItemAt:to:)

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

```
optional func fileManager(_ fileManager: FileManager, shouldProceedAfterError error: any Error, linkingItemAt srcURL: URL, to dstURL: URL) -> Bool
```

## Parameters

`fileManager`

The file manager object that attempted to create the link.

`error`

The error that occurred during the link attempt.

`srcURL`

The URL of the attempted link location.

`dstURL`

The URL of the file or directory that was the destination of the hard link.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the operation should proceed or <doc://com.apple.documentation/documentation/Swift/false> if it should be aborted. If you do not implement this method, the file manager assumes a response of <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

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 <doc://com.apple.documentation/documentation/Swift/true>, 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:)`](/documentation/Foundation/FileManagerDelegate/fileManager(_:shouldProceedAfterError:linkingItemAtPath:toPath:)) method and is preferred over that method in macOS 10.6 and later.

## See Also

[`-  linkItemAtURL:toURL:error:`](/documentation/Foundation/FileManager/linkItem(at:to:))

Creates a hard link between the items at the specified URLs.

[`-  linkItemAtPath:toPath:error:`](/documentation/Foundation/FileManager/linkItem(atPath:toPath:))

Creates a hard link between the items at the specified paths.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)