Important: The information in this document is obsolete and should not be used for new development.
Identifying Files, Directories, and Volumes
Whenever you want to perform some operation on a file, directory, or volume, you need to identify the target item to the File Manager. Exactly how you specify these items in the file system depends on several factors, including which version of system software is currently running and, if the target item is a file, whether it is open or closed. For example, once you have opened a file, you subsequently identify that file to the File Manager by providing its file reference number, a unique number returned to your application when you open the file.In all other cases, you can identify files, directories, and volumes to the File Manager
by using a variety of methods. In addition to file reference numbers, the File
Manager recognizes
This section describes each of these ways to identify items in the file system. Note, however, that some of these methods are of historical or theoretical interest only. Working directory reference numbers exist solely to provide compatibility with the now-obsolete Macintosh file system (MFS), and their use is no longer recommended. Similarly, the use of full pathnames to specify volumes, directories, or files is not generally recommended.
- file system specifications
- file ID references
- directory ID numbers
- volume reference numbers
- working directory reference numbers
- names and full or partial pathnames
Whenever possible, you should use file system specifications to identify files and directories because they provide the simplest method of identification and are recognized by the Finder, the Standard File Package, and other system software components beginning with system software version 7.0. If your application is intended to run in system software versions in which the routines that accept file system specification records are not available, you should use the volume reference number, parent directory ID, and name of the item you wish to identify.
Subtopics
- File System Specifications
- File IDs
- Directory IDs
- Volume Reference Numbers
- Working Directory Reference Numbers
- Names and Pathnames
- HFS Specifications
- Search Paths