About FilesTo the user, a file is simply some data stored on a disk. To your application, a file is a named, ordered sequence of bytes stored on a Macintosh volume, divided into two forks (as described in the following section, "File Forks"). The information in a file can be used for any of a variety of purposes. For example, a file might contain the text of a letter or the numerical data in a spreadsheet; these types of files are usually known as documents. Typically a document is a file that a user can create and edit. A document is usually associated with a single application, which the user expects to be able to open by double-clicking the document's icon in the Finder.
A file might also contain an application. In that case, the information in the file consists of the executable code of the application itself and any application-specific resources and data. Applications typically allow the user to create and manipulate documents. Some applications also create special files in which they store user-specific settings; such files are known as preferences files.
The Macintosh Operating System also uses files for other purposes. For example, the File Manager uses a special file located in a volume to maintain the hierarchical organization of files and folders in that volume. This special file is called the volume's catalog file. Similarly, if virtual memory is in operation, the Operating System stores unused pages of memory in a disk file called the backing-store file.
No matter what its function, each file shares certain characteristics with every other file. This section describes these general characteristics of Macintosh files, including
- file forks
- file size and access characteristics
- file system organization
- file naming and identification
- File Forks
- File Size
- File Access Characteristics
- The Hierarchical File System
- Identifying Files and Directories