Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!hellgate.utah.edu!caen!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!cbnewsl!cbnewsk!ech From: ech@cbnewsk.att.com (ned.horvath) Newsgroups: comp.sys.mac.programmer Subject: Re: Working Directory Questions Message-ID: <1990Nov16.191340.20064@cbnewsk.att.com> Date: 16 Nov 90 19:13:40 GMT References: <1990Nov16.130543.18925@jarvis.csri.toronto.edu> Organization: AT&T Bell Laboratories Lines: 26 From article <1990Nov16.130543.18925@jarvis.csri.toronto.edu>, by west@turing.toronto.edu (Tom West): > I have a problem with Working Directories... So does anyone else who needs to "remember" a directory. > Unfortunately, I have to use WDs, since the user can specify a partial > pathname, full path name or just a file name with a specified directory > as the base directory... Fortunately, you don't. Feed the WDRefNum returned by standard file as the ioVRefNum parameter to PBGetWDInfo. Make sure you set ioNamePtr, ioWDIndex, and ioWDProcID to zero. Save the results returned in ioWDVRefNum and ioWDDirID. Later, you can supply those to PBHOpen (NOT PBOpen) as the ioVRefNum and ioDirID, respectively. Partial pathnames in the ioNamePtr argument to PBHOpen are cool. Oh, yeah: the ioWDVRefNum is only valid until the volume is dismounted. If you need to remember the volume across dismounts (this include, but is not limited to, reboots), you should pass the address of a Str255 in the ioNamePtr argument to PBGetWDInfo, and cache that as well. Later, you can use PBGetVolInfo to get the correct ioVRefNum for that volume. Hope that helps. =Ned Horvath=