Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!agate!bionet!ames!claris!apple!alan From: alan@Apple.COM (Alan Mimms) Newsgroups: comp.sys.mac.programmer Subject: Re: Getting a complete pathname Message-ID: <734@internal.Apple.COM> Date: 21 Feb 89 17:39:48 GMT References: <7326@june.cs.washington.edu> Organization: Apple Computer Inc, Cupertino, CA Lines: 23 In article <7326@june.cs.washington.edu> marty@june.cs.washington.edu (Marty Sirkin) writes: >name and directory ref number. I really need the pathname, not the number >as I need to use the staandard pascal reset/rewrite... You can create a textual pathname given a directory ref num easily. The idea is to climb up via the parent directory ID from the directory you've been given, prepending the name of each directory as you go to the results of the previous iterations. Just use the PBGetCatInfo trap with ioFDirIndex set to -1 and ioDrDirID set to zero. After each trap, set the ioDrDirID to the ioDrParID returned by the just-completed call. The ioNamePtr should point to a buffer, in which the portion of the pathname pertaining to the current folder is returned. You can catenate these together (first-in-last-out) to build a complete pathname. Stop the iteration when you get a dirID of 2, which is the root directory (always). Hope this helps. -- Alan Mimms My opinions are generally Communications Products Group pretty worthless, but Apple Computer they *are* my own... ...it's so simple that only a child can do it! -- Tom Lehrer, "New Math"