Bundle

From Mac Guides

Jump to: navigation, search

A bundle, also known as a package, is a special kind of folder that groups resources together, but is displayed in Finder as if it were a single file. Bundles are typically used for applications (.app), frameworks (.framework) and plugins (.plugin), but can also be used for other purposes such as for Rich Text Files (RTFs) that include graphics (.rtfd), incomplete Safari downloads (.download) and installer packages (.pkg).

A file can be quickly determined to be a bundle by control-clicking it and checking if "Show Package Contents" is a menu item. If it is, then the file is a bundle.

Application bundles

Contents of a typical application bundle
Enlarge
Contents of a typical application bundle

Most Mac OS X applications are now bundles. The introduction of bundles was aimed to reduce the dependence on a resource fork, traditionally used to store resources, which are not compatible with some file systems. With bundles, resources are stored as files inside the bundle.

At the root level of an application bundle is a folder called Contents, which contains a number of standard subfolders and files:

  • Frameworks - Optional folder containing frameworks used by the application
  • Info.plist - File containing certain information about the application, such as version information
  • MacOS - Folder containing executable code
  • PlugIns - Optional folder containing any installed plugins
  • PkgInfo - File containing the bundle's file type and creator, used mainly in Mac OS 9
  • Resources - Folder containing resources used by the application, including interface (nib) files, graphics and documentation