A unique concept introduced with Mac OS X is that of the bundle. Bundles take many different forms: frameworks, applications, and software plug-ins can come packaged as bundles . A bundle is essentially a directory structure in the filesystem that is treated by the Finder as a single entity. For example, the Backup application included with a .Mac subscription will appear in the Applications folder as a single, double-clickable item. If you were to view the same application from the Terminal, you’d see that it is actually a directory, as shown in Example 3-4.
Example 3-4. Viewing the contents of an application bundle
$ ls -la /Applications/Backup.app/
total 0
drwxrwxr-x 3 root admin 102 May 17 09:09 .
drwxrwxr-x 57 root admin 1938 Aug 31 08:52 ..
drwxrwxr-x 8 root admin 272 Apr 23 2004 Contents
While the Finder hides this fact, you can expose it by right-clicking (or Control-clicking) the application and choosing Show Package Contents. This will show you the bundle’s contents, as shown in Figure 3-6.
Not all bundles are applications. Some software programs use bundles as their file formats (for example, the Mac OS X Installer’s .pkg
files) as well as the development frameworks that are included with the OS. One of the nicest things about bundles is that they work behind the scenes, enabling a complete application to be presented as a single icon in the Finder. This makes removing, moving, and installing a piece of software a simple drag and drop operation.