Curious semi-technical question about a Mac Feature

ZeroAltitude

Registered
You know one thing that is very impressive about Macs, for someone coming from a PC world? It's that, when you make an alias, or a dock image of an application, you can *move the folder that the application is in without breaking the alias or dock image*.

I think that's amazing.

So could someone, preferably a system's engineer or a programmer, but anyone who knows would do, please tell me how this is done by MacOS? I am a programmer, and the idea of an alias or image that references a path to a file makes good sense, but... the mac doesn't have a registry, and so I can't really visualize how the MacOS can map these launchers to... to what? To a Finder-search pattern? To a special link to a filesystem inode that doesn't change when the file moves?

What gives? How do these guys make my life so damn easy? I'm a programmer -- I'm uncomfortable not knowing! ;)

Thanks,

-0
 
And if like in X-windows, there are special files somewhere on my drive that Mac OSX uses for dock image references, or if there's a resource file that is used for the same, could someone point me to it so I could learn the features of that file/resource?

Rock on.

-0
 
Well, aliases under MacOS using HFS/HFS+ behave rather uniquely. Each file, folder/etc. on your computer is given a unique id number. If you move the item, this id doesn't change, if you make a copy to another partition, HD, or just duplicate it, this copy will have a DIFFERENT id number.

So when you just move a target of an alias, it still knows what item is the real one, since it defaults to finding the item by id number, and opens it up rather than using the path that is also included in the alias for speed.

Dock image references? As far as I know, it just pulls on the icon files in the bundles for the apps/docklings. Since MacOS X uses a folder to enclose the binary and the files it needs, the icon used for an app in the finder is the one used in the dock. Docklings sometimes break this, but still have the icon stored within the bundle. System icons such as folders, the trash, and the translucent background are part of a bundle that contains GUI resources for images and whatnot to produce the Aqua look.
 
about the id: right, i believe. but there's also a hidden 'desktop database' file. was in mac os 9, is in mac os x. this database file *knows* where you've dragged something. but if you move or alias via the Terminal, that information will not be saved, afaik.
 
Right, since an alias is just a particular type of file, while a symbolic link is just a reference to another path (which is stored in a file)...

The DB from OS 9 is gone, and one will notice that this HAS changed the behavior of searching for apps (MacOS 9.2.x even follows this behavior at times too) only in the Applications folder when it is first opening a file of some sort of new type/etc.

I think what you are referring to is the HFS+ catalog and b-tree which holds information on pretty much all the files/folders on the drive, so you should be able to search by ID number that way if I am not mistaken.
 
Back
Top