0

Maybe it's just me, but it seems like Mac OS knows where a file is even when it's moved. Does anybody know why this is?

5

In addition to the file's path, Mac OS aliases record several pieces of additional information: the file's unique ID, its parent directory ID, file size, [possibly creation time]; which are used to locate the most probable match in case of a broken link. I think most of the time a file is found by its unique ID, which does not change after a rename.

See also Alias (Mac OS) on Wikipedia.

| improve this answer | |
  • By the way, Windows is able to fix broken shortcuts in a very similar way (using an unique ID first, the file's timestamps and size if the ID lookup fails). – user1686 Apr 8 '11 at 15:43
5

The Mac file system is called HFS+. It uses inode numbers in a B-tree, with the physical and logical location (three parts in total). Metadata is in another b-tree, along with the data-forks.

So it knows what to expect in a place, knows of another way to refer to it, looks that up and there you go. It's like if someone moved house, you still have their mobile phone number to call.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.