---
title: FileManagerDelegate
framework: foundation
role: symbol
role_heading: Protocol
path: foundation/filemanagerdelegate
---

# FileManagerDelegate

The interface a file manager’s delegate uses to intervene during operations or if an error occurs.

## Declaration

```swift
protocol FileManagerDelegate : NSObjectProtocol
```

## Overview

Overview The FileManagerDelegate protocol defines optional methods for managing operations involving the copying, moving, linking, or removal of files and directories. When you use an FileManager object to initiate a copy, move, link, or remove operation, the file manager asks its delegate whether the operation should begin at all and whether it should proceed when an error occurs. The methods of this protocol accept either NSURL or NSString objects. The file manager always prefers methods that take an NSURL object over those that take an NSString object. You should associate your delegate with a unique instance of the FileManager class, as opposed to the shared instance.

## Topics

### Moving  an Item

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

### Copying  an Item

- [fileManager(_:shouldCopyItemAt:to:)](foundation/filemanagerdelegate/filemanager(_:shouldcopyitemat:to:).md)
- [fileManager(_:shouldCopyItemAtPath:toPath:)](foundation/filemanagerdelegate/filemanager(_:shouldcopyitematpath:topath:).md)
- [fileManager(_:shouldProceedAfterError:copyingItemAt:to:)](foundation/filemanagerdelegate/filemanager(_:shouldproceedaftererror:copyingitemat:to:).md)
- [fileManager(_:shouldProceedAfterError:copyingItemAtPath:toPath:)](foundation/filemanagerdelegate/filemanager(_:shouldproceedaftererror:copyingitematpath:topath:).md)

### Removing an Item

- [fileManager(_:shouldRemoveItemAt:)](foundation/filemanagerdelegate/filemanager(_:shouldremoveitemat:).md)
- [fileManager(_:shouldRemoveItemAtPath:)](foundation/filemanagerdelegate/filemanager(_:shouldremoveitematpath:).md)
- [fileManager(_:shouldProceedAfterError:removingItemAt:)](foundation/filemanagerdelegate/filemanager(_:shouldproceedaftererror:removingitemat:).md)
- [fileManager(_:shouldProceedAfterError:removingItemAtPath:)](foundation/filemanagerdelegate/filemanager(_:shouldproceedaftererror:removingitematpath:).md)

### Linking an Item

- [fileManager(_:shouldLinkItemAt:to:)](foundation/filemanagerdelegate/filemanager(_:shouldlinkitemat:to:).md)
- [fileManager(_:shouldLinkItemAtPath:toPath:)](foundation/filemanagerdelegate/filemanager(_:shouldlinkitematpath:topath:).md)
- [fileManager(_:shouldProceedAfterError:linkingItemAt:to:)](foundation/filemanagerdelegate/filemanager(_:shouldproceedaftererror:linkingitemat:to:).md)
- [fileManager(_:shouldProceedAfterError:linkingItemAtPath:toPath:)](foundation/filemanagerdelegate/filemanager(_:shouldproceedaftererror:linkingitematpath:topath:).md)

## Relationships

### Inherits From

- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### File system operations

- [Improving performance and stability when accessing the file system](foundation/improving-performance-and-stability-when-accessing-the-file-system.md)
- [Using the file system effectively](foundation/using-the-file-system-effectively.md)
- [FileManager](foundation/filemanager.md)
- [About Apple File System](foundation/about-apple-file-system.md)
