---
title: filenameCollision
framework: fileprovider
role: symbol
role_heading: Type Property
path: fileprovider/nsfileprovidererror/filenamecollision
---

# filenameCollision

An error indicating that an item with the same name already exists in the same directory.

## Declaration

```swift
static var filenameCollision: NSFileProviderError.Code { get }
```

## Discussion

Discussion Use the fileProviderErrorForCollision(with:) method to create properly formatted filenameCollision errors. You have two options for resolving file name collisions: Your file provider extension can return this error. In this case the system renames the new item. You can rename the new item yourself. This gives you complete control over the process.

## See Also

### Accessing error codes

- [NSFileProviderError.Code](fileprovider/nsfileprovidererror/code.md)
- [insufficientQuota](fileprovider/nsfileprovidererror/insufficientquota.md)
- [noSuchItem](fileprovider/nsfileprovidererror/nosuchitem.md)
- [notAuthenticated](fileprovider/nsfileprovidererror/notauthenticated.md)
- [pageExpired](fileprovider/nsfileprovidererror/pageexpired.md)
- [serverUnreachable](fileprovider/nsfileprovidererror/serverunreachable.md)
- [syncAnchorExpired](fileprovider/nsfileprovidererror/syncanchorexpired.md)
- [directoryNotEmpty](fileprovider/nsfileprovidererror/directorynotempty.md)
- [providerNotFound](fileprovider/nsfileprovidererror/providernotfound.md)
- [providerTranslocated](fileprovider/nsfileprovidererror/providertranslocated.md)
- [olderExtensionVersionRunning](fileprovider/nsfileprovidererror/olderextensionversionrunning.md)
- [newerExtensionVersionFound](fileprovider/nsfileprovidererror/newerextensionversionfound.md)
- [nonEvictable](fileprovider/nsfileprovidererror/nonevictable.md)
- [nonEvictableChildren](fileprovider/nsfileprovidererror/nonevictablechildren.md)
- [unsyncedEdits](fileprovider/nsfileprovidererror/unsyncededits.md)
