Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!apple!keith From: keith@Apple.COM (Keith Rollin) Newsgroups: comp.sys.mac.programmer Subject: Re: How do you open your application's own data fork? Message-ID: <54498@apple.Apple.COM> Date: 1 Jul 91 01:29:51 GMT References: <1991Jun29.002528.4831@neon.Stanford.EDU> <54493@apple.Apple.COM> <54497@apple.Apple.COM> Organization: Apple Computer Inc., Cupertino, CA Lines: 28 In article <54497@apple.Apple.COM> mkelly@Apple.COM (Michael Kelly) writes: >In article <54493@apple.Apple.COM> keith@Apple.COM (Keith Rollin) writes: >>In article <1991Jun29.002528.4831@neon.Stanford.EDU> commons@Sunburn.Stanford.EDU (Peter Commons) writes: >>>The title says it all. I want to store and retrieve data from an application's >>>own data fork. How do you open it/ get a reference number for it? >> >>The idea that immediately occurs to me is to get the application's >>resource fork refNum by calling CurResFile() at the start of your >>application. Next, find the location and name of the resource file by >>calling GetFCBInfo(). That will give you the vRefNum, dirID, and file >>name that you need to call HOpen(). >> > >Why don't you just call GetAppParms (as documented in IM II, pg. 58). It >returns the name of your application, the reference number for the >application's resource file, and a handle to some finder information (info >about documents that were selected when the application was launched). Right! I _knew_ there was a better way! Do what Mike says, not what I said. I was recently playing around with INITs (which don't get to call GetAppParms), and forgot the correct way of doing things. -- ------------------------------------------------------------------------------ Keith Rollin --- Apple Computer, Inc. INTERNET: keith@apple.com UUCP: {decwrl, hoptoad, nsc, sun, amdahl}!apple!keith "But where the senses fail us, reason must step in." - Galileo