Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!apple!mkelly From: mkelly@Apple.COM (Michael Kelly) Newsgroups: comp.sys.mac.programmer Subject: Re: How do you open your application's own data fork? Message-ID: <54497@apple.Apple.COM> Date: 1 Jul 91 01:02:58 GMT References: <1991Jun29.002528.4831@neon.Stanford.EDU> <54493@apple.Apple.COM> Organization: Apple Computer Inc., Cupertino, CA Lines: 22 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). Mike. -- _____________________________________________________________________________ Michael A. Kelly America Online: Michael792 mkelly@cs.uoregon.edu or mkelly@apple.com Compu$erve: 73567,1651 _____________________________________________________________________________