Path: utzoo!attcan!uunet!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!rpi!bu.edu!dartvax!chocorua!kurash From: kurash@chocorua.dartmouth.edu (Mark Valence) Newsgroups: comp.sys.mac.programmer Subject: Re: Probably a simplistic question, but I haven't seen the answer Summary: A less simple answer Keywords: GetVol, PMSP Message-ID: <24323@dartvax.Dartmouth.EDU> Date: 17 Sep 90 16:46:51 GMT References: <701@sun13.scri.fsu.edu> Sender: news@dartvax.Dartmouth.EDU Reply-To: kurash@chocorua (Mark Valence) Distribution: comp Organization: Dartmouth College Lines: 45 In article <701@sun13.scri.fsu.edu> pepke@gw.scri.fsu.edu (Eric Pepke) writes: >The answer, at least, is simple. Don't use HFS calls. Use MFS calls. >The folder in which the application sits is in the Poor Man's Search Path. That's certainly one simple answer. In case the original poster does not know what the Poor Man's Search Path is (if you only have IM I & II, you may not know), it is the 'list' of folders the File Manager checks whenever you Open files (or do various other operations). Another way to do this is to make this call immediately after your manager Initialization (_InitGraf,...,_InitWindows, TEInit, etc): theErr := GetVol(nil, appFolder); (in this case theErr:OSErr and appFolder:integer) This way you can have the VRefNum of the folder from which your application was launched at the tip of your fingers for the entire time your program runs. When you do an FSOpen call: theErr := FSOpen(fileName, appFolder, refNum); alternately, for a PBOpen: ... pb.ioVRefNum := appFolder; ... theErr := PBOpen(@pb, false); These calls are similar in C, if that's your preference. >Eric Pepke INTERNET: pepke@gw.scri.fsu.edu >Supercomputer Computations Research Institute MFENET: pepke@fsu >Florida State University SPAN: scri::pepke >Tallahassee, FL 32306-4052 BITNET: pepke@fsu > >Disclaimer: My employers seldom even LISTEN to my opinions. >Meta-disclaimer: Any society that needs disclaimers has too many lawyers. Any society that *has* lawyers has too many lawyers. Attorneys are another story. Mark.