Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!shadooby!samsung!gem.mps.ohio-state.edu!apple!apple.com!blob From: blob@apple.com (Brian Bechtel) Newsgroups: comp.sys.mac.programmer Subject: Re: Repeat SetVol query Message-ID: <4967@internal.Apple.COM> Date: 31 Oct 89 00:09:11 GMT References: <3260@carthage.cs.swarthmore.edu> Sender: usenet@Apple.COM Organization: Apple Computer, Inc. Lines: 16 In article <3260@carthage.cs.swarthmore.edu> jackiw@cs.swarthmore.edu (Nick Jackiw) writes: > You can't SetVol(...) to the working directory returned by SFGetFile > under HFS. Even if you GetWDInfo and translate the wdRef into a volRef+ > DirID, you can SetVol(...) to the volume (root directory) but not to > the DirID. > > So how can you set the current default directory used by "Create", > "Open", and "OpenResFile" knowing only the SFReply.vRefnum? You use PBGetWDInfo (Inside Macintosh, page IV-159) to get the volume name (in ioNamePtr) and DirID (in ioWDDirID). To get the ioVRefNum given the name of the volume, the DirID, and the name of the file, use PBOpenWD (Inside Macintosh, page IV-158). --Brian Bechtel blob@apple.com "My opinion, not Apple's"