• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

2.6. File Types

A file is a basic unit of filesystem currency in any modern operating system. The following sections discusses some of the file types you'll find in Mac OS X.

Mac OS X's Application-to-Document Map

The system determines a document's kind in one of two ways. First it sees if the document has an attribute fork, a data attachment possessed by documents created by Classic and Carbon applications that provides information about the document's type (among other things). If the file lacks a attribute fork, it looks to the document's filename extension; Mac OS X maintains a system- wide map between these extensions and recognized document types.

The system's map that binds particular filename extensions to certain Aqua applications is made from two sorts of files. Each application's Info.plist file (see Chapter 22) can define the filename extensions its documents use. For example, Terminal application files have the extension .term, and it says as much in its Info file (located, for the curious, at /Applications/Terminal.app/ Contents/Info.plist. If only one application lays claim to a particular file extension (as is the case with .term, at least in a fresh Mac OS X installation), the system will recognize a binding between that application and all files with that extension; double-clicking these documents in the Finder will open them through that application.

These claims, however, may be overruled by the contents of another file: com.apple.LaunchServices.plist, which is another XML property list file that exists in your Home folder's /Library folder (see Chapter 9). It lists the preferences that you have stated (through the Finder's Show Info window, and other means) regarding what applications to use with which files, or classes of files.

If the Finder encounters an ambiguity due to two or more applications recognizing the same file extension (as is the case with Acrobat Reader and Apple's Preview application with .pdf files), the system again looks to this file, seeing if the user has a stated preference. If not, it will favor a Carbon or Cocoa application over a Classic one and, failing that, an application with a more recent modification time on the filesystem.

Based on this attached information, a document's icon gets its image, its "Kind" label (as it appears in List view; see Section 2.2.2 later in this chapter), and knowledge of which application it will activate when double-clicked. You can, however, adjust any of these connections through the document's Info window, as detailed in Section 2.11.

See Chapter 7 for further detail on how Mac OS X manages its files.



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint