# Error Domain=NSCocoaErrorDomain Code=260 "The file couldn't be opened because there is no such file."

**Code:** `File not found after app update (Documents path changed)` · **Category:** iOS · **Seen on:** iOS, Swift

A saved absolute path no longer exists.

## Meaning

The app container UUID changes between installs/updates. Store relative paths and rebuild URLs from `FileManager.default.urls(for:in:)` each launch.

## Common causes

- Absolute path persisted
- Container changed
- File deleted by system (Caches)

## Quick fix

1. Save only the file name
2. Rebuild URL from Documents directory
3. Don't store data in Caches

## Detailed fix by platform

### Swift

1. 

```swift
let docs = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0]
let url = docs.appendingPathComponent(name)
```


## How to diagnose

1. **Path** — absolute?
2. **Dir** — Documents?
3. **Cache** — purged?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/ios/foundation-file-not-found-documents-path-changes)
