Path: utzoo!attcan!uunet!husc6!bloom-beacon!mit-eddie!killer!pollux!ti-csl!m2!holland From: holland@m2.csc.ti.com (Fred Hollander) Newsgroups: comp.sys.mac.programmer Subject: Re: Setting a default folder Keywords: FSGetFile Message-ID: <63566@ti-csl.CSNET> Date: 15 Nov 88 17:18:30 GMT References: <63398@ti-csl.CSNET> <1479@murdu.OZ> Sender: news@ti-csl.CSNET Reply-To: holland@m2.UUCP (Fred Hollander) Organization: TI Computer Science Center, Dallas Lines: 39 In article <1479@murdu.OZ> grae@murdu.UUCP (Graeme Gerrard) writes: >> topaz.rutgers.edu wants to know about setting default directories. > >From memory, what you need is to get the ioWDDirID of the >directory you want as your default. If you only know the >NAME of the directory, you can get the ioWDDirID by calling >PBHSetVol, passing a WDPBRec with the name in ioNamePtr, >ioVRefNum = 0 and ioWDDirID = 0L. Calling PBHSetVol is dangerous as explained in Tech Note 140. It sets the volume and directory separately, so subsequent calls to PBGetVol and GetVol will return the RefNum of the root directory, not the default directory. >Then call PBHGetVol and with the same parameter block and it >returns the ioWDDirID of the directory you are after. >Now set the global, CurDirStore, to the ioWDDirID, and call >SFGet/PutFile. The result is a "set directory" before you get >your dialog box up. I think he wanted to use the dialog to set the directory. SFGetFile will put up the standard file dialog and return the RefNum of the chosen directory (SFReply.vRefNum). Use this value to set the default directory using SetVol. > >Disclaimer: Just because this works for me, don't mean it's >going to work for you. >I can send you a SetDirectory function in C if you mail me. >------------------------------------------- >Graeme Gerrard >Faculty of Music, University of Melbourne >ARPANET: grae@murdu.oz.au >------------------------------------------- Fred Hollander Computer Science Center Texas Instruments, Inc. holland%ti-csl@csnet-rela The above statements are my own and not representative of Texas Instruments.