Path: utzoo!attcan!uunet!munnari.oz.au!uhccux!ames!apple!austing From: austing@Apple.COM (Glenn L. Austin) Newsgroups: comp.sys.mac.programmer Subject: Re: Data Fork Of Currently Running APPL Message-ID: <42938@apple.Apple.COM> Date: 13 Jul 90 20:04:21 GMT References: <81985@tut.cis.ohio-state.edu> <561@ohs.UUCP> Organization: Apple Computer Inc., Cupertino, CA Lines: 31 bhil@ohs.UUCP (Brian T. Hill) writes: >From article <81985@tut.cis.ohio-state.edu>, by topping@chinook.cis.ohio-state.edu (brian e topping): >> >> 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 >> >Hmm. I think I've read somewhere (TechNote maybe?) that you can't get the >application's dirID by getting the current dirID when the application is >first opened. Apparently, this method will fail if the application was >Launched by another application or some variation of that theme. You can use PBGetFCBInfo with the CurResFile() as the refNum of the file. This will return GOBS of info about the file, including the dirID and vRefNum. PBGetFCBInfo is on pg. 179 of IM 4. -- ----------------------------------------------------------------------------- | Glenn L. Austin | "Turn too soon, run out of room, | | Auto Racing Enthusiast and | Turn too late, much better fate" | | Communications Toolbox Hacker | - Jim Russell Racing School Instructors | | Apple Computer, Inc. | "Drive slower, race faster" - D. Waltrip | | Internet: austing@apple.com |-------------------------------------------| | AppleLink: AUSTIN.GLENN | All opinions stated above are mine -- | | Bellnet: (408) 974-0876 | who else would want them? | -----------------------------------------------------------------------------