Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!bloom-beacon!husc6!lloyd!kent From: kent@lloyd.camex.uucp (Kent Borg) Newsgroups: comp.sys.mac.programmer Subject: Standard File Hacking Message-ID: <421@lloyd.camex.uucp> Date: 15 Jun 89 21:30:18 GMT References: <819@tekno.chalmers.se> <419@lloyd.camex.uucp> Reply-To: kent@lloyd.UUCP (Kent Borg) Organization: Camex, Inc., Boston, Mass USA Lines: 22 In article <419@lloyd.camex.uucp> I write: >About *my* recent question of how to find out the directory of the >currently selected file in SFGetFile at hook time. Yes, -1 * >SFSaveDisk is the volume and CirDirStore is the dirID. That works. >What I don't know is a good way to get from there to opening the >currently selected file with OpenResFile. I figured it out. Turns out to be easy. PBHSetVol was the answer. Call GetVol and remember the result, stuff a WDPBRec parameter block, call PBHSetVol, call OpenResFile, call SetVol to restore the remembered value (see Tech Note 140). Other than a random set of illegal instruction bombs, it works. (Must dig about looking for uninitialized thingies.) I never did figure out why my sequence of calls to SetVol didn't do it--I don't really know what SetVol is supposed to do and Inside Macintosh is very terse on the subject--but I do know a lot more about HFS now. Kent Borg kent@lloyd.uucp or ...!husc6!lloyd!kent