Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Files /
Chapter 2 - File Manager / Identifying Files, Directories, and Volumes


Directory IDs

A directory ID is a unique number that the File Manager uses to distinguish one directory from another on the same volume. Assigned by the File Manager when the directory is created, a directory ID is simply the catalog node ID of a directory. As a result, directory IDs are functionally equivalent to file IDs, and both kinds of IDs are assigned from the same set of numbers.

Directory IDs are long integers. The File Manager defines several constants to refer to special directory IDs that exist on every volume.

CONST
   fsRtParID   =  1;    {directory ID of root directory's parent}
   fsRtDirID   =  2;    {directory ID of volume's root directory}
The root directory of every volume has a directory ID of 2. In addition, the root directory of every volume has a parent directory ID of 1. There is, however, no such parent directory; the constant fsRtParID is provided solely for use by applications and File Manager routines that need to specify a parent ID when referring to the volume's root directory. For example, if you call the PBGetCatInfo function when the ioDirID field is set to fsRtDirID, the value fsRtParID is returned in the ioDrParID field.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996