Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!gem.mps.ohio-state.edu!usc!sdsu!ucsd!helios.ee.lbl.gov!ux1.lbl.gov!beard From: beard@ux1.lbl.gov (Patrick C Beard) Newsgroups: comp.sys.mac.programmer Subject: Re: INIT getting it's file name... Message-ID: <4020@helios.ee.lbl.gov> Date: 26 Oct 89 09:47:06 GMT References: <56505@tiger.oxy.edu> Sender: usenet@helios.ee.lbl.gov Reply-To: beard@ux1.lbl.gov (Patrick C Beard) Distribution: usa Organization: Lawrence Berkeley Laboratory, Berkeley Lines: 27 In article <56505@tiger.oxy.edu> sonenbli@oxy.edu (Andrew D. Sonenblick) writes: > > Ok, this is a quick one but it is very important: is there any way >for an INIT to get the name of the file it is in? I need to later open >the resource fork of the file and I want the user to be able to change the >name of the file; hence, my INIT needs to be able to read in the file name. >Please inform me or the whole net of any solution. Thanks. > >Ando Sonenblick: sonenbli@oxy.edu The best way is to give your init file a unique creator type. MacDTS registers these so that developers won't have conflicts. Then, since you know that the type of your file is 'INIT', just search through the system folder (every time you need your file) searching for your file with creator = '!&*(' and type = 'INIT' ('!&*(' not to be taken literally of course, unless your mad). How does one search the system folder? Ah... I'll leave that as an exercise for the reader. :^). help, help, this article needs more length! ------------------------------------------------------------------------------- - Patrick Beard, Macintosh Programmer (beard@lbl.gov) - - Berkeley Systems, Inc. "..............Good day!" - Paul Harvey - -------------------------------------------------------------------------------