Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!axiom!drilex!rclex!harvard!olson From: olson@endor.harvard.edu (Eric Olson) Newsgroups: net.micro.mac Subject: Re: Directory name from DirID? Message-ID: <17@harvard.UUCP> Date: Fri, 13-Jun-86 11:13:52 EDT Article-I.D.: harvard.17 Posted: Fri Jun 13 11:13:52 1986 Date-Received: Sat, 14-Jun-86 06:20:36 EDT References: <157@zyx.UUCP> Sender: news@harvard.UUCP Reply-To: olson@endor.UUCP (Eric Olson) Organization: Aiken Comp Lab, Harvard Lines: 19 Keywords: HFS In article <157@zyx.UUCP> grzm@zyx.UUCP (Gunnar Blomberg) writes: > > Is there a way to get the directory name from the directory id, >without searching through the directory tree or going to disk yourself? >If so, how is it done? I believe there are not any system calls that will do this for you. I had to do this, and ended up using the recursive hierarchical search- all-files described in Apple Tech Note 68. Note that you must check the directory bit, and IF IT IS SET, ioDrDirID will be the directory ID (which you match against) and ioNamePtr will be the name. If the directory bit is not set, ioDrDirID will be a File Number. In either case, you MUST reset ioDrDirID to the directory you are searching, since it is modified by the call to reflect the file number of dirID of a directory. The other alternative is to search the Catalog Tree file, but its format is very hairy and subject to change. -Eric