Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!chinook.cis.ohio-state.edu!topping From: topping@chinook.cis.ohio-state.edu (brian e topping) Newsgroups: comp.sys.mac.programmer Subject: Re: Data Fork Of Currently Running APPL Message-ID: <81985@tut.cis.ohio-state.edu> Date: 9 Jul 90 15:16:08 GMT References: <1990Jul5.195908.28307@uswmrg2.UUCP> Sender: news@tut.cis.ohio-state.edu Reply-To: brian e topping Organization: Ohio State University Computer and Information Science Lines: 21 In article <1990Jul5.195908.28307@uswmrg2.UUCP> steve@uswmrg2.UUCP (Steve Martin) writes: >In article cl29+@andrew.cmu.edu (Cameron Christopher Long) writes: >>Hi, >> >>I am working on a program that stores data in its data fork. Currently, >>I am opening the data fork using FOPEN since I know the name of the APPL. >>However, if someone renames the program, how will I know what to open? > >Why not look at the low memory CurApName? Check Inside Macintosh II page 58. >-- If you are working in C you can use the argv[] argument vectors passed to the main() procedure. The name of the program will be in a C string pointed to by argv[0]. If you want the dirID, you can get it by a _GetVol to find the working directory followed by a _GetWDInfo to find the dirID before you do any file system calls that change the world as the application started. Brian Topping