---
title: "fileManager(_:shouldMoveItemAtPath:toPath:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/filemanagerdelegate/filemanager(_:shouldmoveitematpath:topath:)"
---

# fileManager(_:shouldMoveItemAtPath:toPath:)

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

## Declaration

```swift
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

Return Value true if the operation should proceed, otherwise false. If you do not implement this method, the file manager assumes a response of true.

## Discussion

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:) method, which is preferred over this method in macOS 10.6 and later.

## See Also

### Related Documentation

- [moveItem(atPath:toPath:)](foundation/filemanager/moveitem(atpath:topath:).md)
- [moveItem(at:to:)](foundation/filemanager/moveitem(at:to:).md)

### Moving  an Item

- [fileManager(_:shouldMoveItemAt:to:)](foundation/filemanagerdelegate/filemanager(_:shouldmoveitemat:to:).md)
- [fileManager(_:shouldProceedAfterError:movingItemAt:to:)](foundation/filemanagerdelegate/filemanager(_:shouldproceedaftererror:movingitemat:to:).md)
- [fileManager(_:shouldProceedAfterError:movingItemAtPath:toPath:)](foundation/filemanagerdelegate/filemanager(_:shouldproceedaftererror:movingitematpath:topath:).md)
