What is URLResourceKey.documentIdentifierKey intended to identify compared with fileIdentifierKey?
Is it expected to persist across save/replace operations, rename, move, app relaunch, or unmount/remount?
Thanks!
On HFS / APFS : these two fields are persistent and will survive operations like unmount/mount, device reboot, app relaunch, rename (including reparent), truncate or write.
The fileIdentifierKey uniquely identifies a filesystem object. It might change if the file gets renamed-over (safe-save). In conjunction with generationIdentifierKey it provides a content version that you can use to detect whether a file was modified (renamed-over or written into).
The documentIdentifierKey on the contrary is transferred from the overridden document to the overriding one during a safe-save, and can therefore be used as an identifier to track files across safe-saves.
Other filesystems might not be able to provide stable fileIdentifierKey across mounts or support documentIdentifierKey at all.