579 words on Mac OS X
Apple are using (and quite likely inherited from Next) that lovely ‘bundle’ system which defines how to store applications on disk. The application itself is a folder (from the Unixy view of the OS anyway) and for some reason that folder contains nothing but another folder named ‘Contents’ which in turn contains everything the application needs.
Usually you’ll find at least a ‘MacOS’ folder which contains the binary or binaries used (if I understand things correctly the original plan was to have the possibility to have several of these folders for binaries which run on different platforms, but still we didn’t get MacOS-PPC and MacOS-x86 folders but universal binary files), you’ll find the ‘Info.plist’ file with all the information about the application and you’ll find the ‘Resources’ folder for, well, resources like images, user interfaces in nib files or localisations.
However, everything else seems to be a bit random and I really wonder why Apple didn’t go for a clean strategy there: Frameworks coming with the application supposedly live in the ‘Frameworks’ folder within the ‘Contents’ folder. And likewise do Plugins live in a ‘PlugIns’ folder at the same location. So you could be forgiven for thinking that all additional ‘special’ folders will be located just inside the ‘Contents’ folder.
Until you want to include an indexing plugin for Spotlight with your application, that is. These are supposed to live in a sub-subfolder ‘Library/Spotlight’ for some reason. And then, when wanting to ship your application with a Quick Look plugin for X.5, said plugin is supposed to live in the sub-subfolder
‘Resources/QuickLook’ . Which means we have a few different locations where ‘additions’ can live, in subfolders of the ‘Contents’ folder, in subfolders of a ‘Library’ folder of the ‘Contents’ folder and in subfolders of the ‘Resources’ folder.
I’ll leave it as an exercise to the reader to discuss the sense and non-sense of giving a nice feature of your OS the sanely spaced name ‘Quick Look’ and then naming the folders containing the relevant plugins (err, Plug-Ins, I suppose, or rather PlugIns) ‘QuickLook’. This is inconsistent. And the only reason I could find for doing this is that it may be easier to type in a Terminal command and that it may break less scripts which are too stupid to handle spaces in paths. Neither of these seems like a particularly good reason. Particularly if the folder in question is sitting right next to folders with sanely written names like ‘Application Support’ or ‘Screen Savers’.
Each of these locations makes sense in some way (I’d say decreasingly by their order) with the first one simply being the most convenient. But I fail to see how mixing all of these locations together makes sense. It just makes it harder to remember which kind of addition goes where. And it also makes it harder to see which goodies an application comes with
Well, they’re very conservative about the possibility of breaking shit on their very stable platform. On the iPhone they had total liberty to change it, and they got rid of the Contents folder + reorganized things.
I agree with that for the ‘Contents’ folder. If there was a time to get rid of that it was when OS X first came out.
But I completely fail to understand the different approaches they took up in recent releases. I may be wrong about this but I suppose that the ability to ship frameworks inside the application is part of the NeXt heritage. But the location for Spotlight plugins has been defined for X.4 and that for Quick Look plugins right now for X.5.
I find it hard to understand why they invented new places for each of them. Not breaking the existing software shouldn’t play a role for those.
Received data seems to be invalid. The wanted file does probably not exist or the guys at last.fm changed something.