[comp.sys.mac.programmer] Data Fork Use

wolf@mel.cipl.uiowa (07/04/90)

I tried once before to get information on using the data fork for applications. 
Has anyone had experience with this?  Can someone suggest a good source for
information?

Thanks to all in advance..


MJW 
WOLF@MEL.CIPL.UIOWA.EDU

austing@Apple.COM (Glenn L. Austin) (07/05/90)

wolf@mel.cipl.uiowa writes:

>I tried once before to get information on using the data fork for applications. 
>Has anyone had experience with this?  Can someone suggest a good source for
>information?

You can simply open the data fork.  No big deal, but you DO have to get the
name and location of the Application (PBGetFCBInfo, IM IV, pg. 179).
The refNum of the resource file is the reference number returned from
OpenResFile or CurResFile.

-- 
-----------------------------------------------------------------------------
| 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?  |
-----------------------------------------------------------------------------

rmh@apple.com (Rick Holzgrafe) (07/06/90)

In article <42652@apple.Apple.COM> austing@Apple.COM (Glenn L. Austin) 
writes:
> wolf@mel.cipl.uiowa writes:
> 
> >I tried once before to get information on using the data fork for 
applications. 
> >Has anyone had experience with this?  Can someone suggest a good source 
for
> >information?
> 
> You can simply open the data fork.  No big deal, but you DO have to get 
the
> name and location of the Application (PBGetFCBInfo, IM IV, pg. 179).
> The refNum of the resource file is the reference number returned from
> OpenResFile or CurResFile.

Perhaps easier is to get the app's name by calling GetAppParms (IM II, pg. 
58) and using that and the default volume refnum (zero, or call GetVol at 
startup and save it) to do the open.

You can write in the data fork if you like, but then your app
won't run right on locked or read-only volumes such as CD-ROMs and some
file servers. Reading is no problem.

(Tried to mail this notion, but it bounced. Sorry to trouble the net.)

==========================================================================
Rick Holzgrafe              |    {sun,voder,nsc,mtxinu,dual}!apple!rmh
Software Engineer           | AppleLink HOLZGRAFE1          rmh@apple.com
Apple Computer, Inc.        |  "All opinions expressed are mine, and do
20525 Mariani Ave. MS: 77-A |    not necessarily represent those of my
Cupertino, CA 95014         |        employer, Apple Computer Inc."