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

# fileManager(_:shouldMoveItemAtPath:toPath:)

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

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

## Parameters

`fileManager`

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

`srcPath`

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

`dstPath`

The new path for the file or directory.

## Return Value

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

## Discussion

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(_:shouldMoveItemAt:to:)`](/documentation/Foundation/FileManagerDelegate/fileManager(_:shouldMoveItemAt:to:)) method, which is preferred over this method in macOS 10.6 and later.

## See Also

[`-  moveItemAtPath:toPath:error:`](/documentation/Foundation/FileManager/moveItem(atPath:toPath:))

Moves the file or directory at the specified path to a new location synchronously.

[`-  moveItemAtURL:toURL:error:`](/documentation/Foundation/FileManager/moveItem(at:to:))

Moves the file or directory at the specified URL to a new location synchronously.



---

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)