Hi Quinn,
I tested both locations with synthetic PNGs on macOS 26.6.2 (25G83), using Preview 11.0 (1113.5.3).
A used FileManager.default.temporaryDirectory.
B used FileManager.default.url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: true).
I confirmed that B resolved to the app container's Documents directory, not the user's ordinary Documents folder.
Both cases used the same Apple Development-signed sandboxed app, identical initial PNG bytes, atomic writing, and the same NSWorkspace open call. The storage root, distinguishing A/B filename labels, and creation times differed.
For each PNG, I selected Rotate Left once in Preview without pressing Command-S, waited at least 10 seconds, and inspected the original file.
In both cases, Preview changed the document title to a copy. Both originals remained 640 × 360 pixels and 10,684 bytes, with unchanged SHA-256 and modification timestamps.
When closing B, Preview asked whether to keep the new copy and stated that the original document would not be changed. I cancelled without saving a separate copy.
The signed app has these three entitlements, all set to true:
com.apple.security.app-sandbox
com.apple.security.files.user-selected.read-write
com.apple.security.files.bookmarks.app-scope
Moving the PNG to the container's Documents directory did not change the observed behavior.
What would you recommend checking next?
Thank you!
Topic:
App & System Services
SubTopic:
Core OS
Tags: