5.1. Basic Bundle Structure
Mac OS X uses bundles for a number of file formats, including applications, frameworks, plug-ins, and certain kinds of documents. You are already familiar with applications and frameworks. Plug-ins are bundles that can be loaded into applications or frameworks at runtime. For example, graphics programs commonly use plug-ins to import functionality into the application. Also, the QuickTime framework can load new codecs, importers, and other things with plug-ins. Some applications use bundles to store document data. For example, Interface Builder .nib files and Xcode project files are both bundles. Not all documents are bundles, however.
Bundles offer a number of different features depending on the specific kind of bundle format in use. No one format takes advantage of all bundle features. The following table outlines the features supported for each bundle format.
| Applications | Frameworks | Plug-ins | Documents | |
|---|---|---|---|---|
| Opaque Directory | ✓ | ✓ | ✓ | |
| Versioned Bundles | ✓ | |||
| The Info.plist File | ✓ | ✓ | ✓ | |
| Executable Code | ✓ | ✓ | ✓ | |
| Global Resources | ✓ | ✓ | ✓ | ✓ |
| Localized Resources | ✓ | ✓ | ✓ |
5.1.1. Opaque Directory
Various parts of the operating system, including the Finder, Dock, and Open / Save panels can treat a bundle directory as if it really were a single file. This prevents people from casually viewing a bundle's contents and making changes to its files and directories. Because users can't see inside these bundles, we refer to them as opaque directories.
Opaque directories are common for applications, plug-ins, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access