Very interesting info!
I can understand that thinking, but it's not the system’s perspective. The system’s "view" here is that the file reference is considered more "authoritative" than the path.
I actually don't have a strong opinion about file reference urls vs. file path urls but from my perspective in the sample it is clear after the second call to createDirectoryAtURL:..., when that method returns, the fileReferenceURL left lingering in that untitleFour instance is pointing to to the wrong folder based on the fact that I fed that URL directly into a method to create a folder, the operation succeeded, yet there is still a chance to accidentally access a completely different folder through that very same instance going through the cached fileReferenceURL.
MacOS itself is heavily still reliant on path, but fileReferenceURLs are the closest construct we have to an API that doesn't fall into this "trap".
Yea. You can't even create a file without a path so there is that. File reference urls are great at certain things (put this file on the pasteboard - it'll work even if it moves) but you'd really need to introduce a slew of new APIs for developers to really be able to go 'pathless.' Would every method to create a file or folder have to take a parent (fileReferenceURL) parameter?
There is a whole class of applications that display / organize files based on their file system location and file reference don't work very well with that concept. How does something like NSPathControl work in a world where there is no file paths? I guess that's the point. File reference urls describe what, but what about where? You might be able to organize a list of files in a tree and manage parent-child relationships using mostly file reference urls (NSURLParentDirectoryURLKey?) but I won't be the guy trying that in 2026!