Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!hoptoad!tim From: tim@hoptoad.uucp (Tim Maroney) Newsgroups: comp.sys.mac.programmer Subject: Re: INIT getting it's file name... Message-ID: <8851@hoptoad.uucp> Date: 31 Oct 89 02:29:19 GMT References: <56505@tiger.oxy.edu> <4020@helios.ee.lbl.gov> <14362@well.UUCP> Reply-To: tim@hoptoad.UUCP (Tim Maroney) Organization: Eclectic Software, San Francisco Lines: 27 In article <14362@well.UUCP> svc@well.UUCP (Leonard Rosenthol) writes: > I don't know what all this mess is about searching the System Folder, >etc. as that is a REAL PAIN, What? How? I've done it in several pieces of code. The File Manager makes it tremendously easy, by using indexed files with PBGetFInfo. It's a very straightforward loop! >So here is the piece of code that >I use for getting not only my INIT's name, but also the vRefNum (OK, WDRefNum) >where I am. But like about three-quarters of the people who answered this question, you ignored his explicitly stated requirement that he wants the user to be able to rename the file. That means that he can't just save the file name at INIT run time, because it could change -- and later, he can't use CurrResFile to find out its file descriptor! PBGetFCBInfo is completely irrelevant to this problem. Kind of sloppy from someone whose first disagreement with me here was posting a mega-flame on how absolutely necessary it is to allow INIT files to be renamed, Leonard. -- Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com "Next prefers its X and T capitalized. We'd prefer our name in lights in Vegas." -- Louis Trager, San Francisco Examiner