Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!ceres.physics.uiowa.edu!news.iastate.edu!sharkey!caen!uakari.primate.wisc.edu!samsung!olivea!apple!stadler Newsgroups: comp.sys.apple2 Subject: Re: question Message-ID: <51917@apple.Apple.COM> From: stadler@Apple.COM (Andy Stadler) Date: 24 Apr 91 01:16:49 GMT References: <1991Apr24.001045.10057@world.std.com> Organization: Apple Computer Inc., Cupertino, CA Lines: 40 In article <1991Apr24.001045.10057@world.std.com> lucifer@world.std.com (Kevin S Green) writes: >In article <1991Apr23.064407.25899@cse.uta.edu> c056hdh@utarlg.uta.edu writes: >> >> can someone tell me what a forked file is? how it is used? and why? >> I'm not a GS programmer or hacker, so I'm sorry if I sound ignorant. > >Basically it is a disk file that is conceptually viewed in two parts. >The first part holds data (or program code), the other holds >resources. Resources are similar to program code, but are things like >definitions for how a window will look and the like. > Just to expand on that a bit, I'll mention the common uses of the two forks. The data fork holds one of two things- Program code, in a format strictly defined by the IIGS System Loader; or application-specific data. The data could be a word proc document, or a graphics image, or anything else. Although many of the data fork data formats have been published, these formats are still essentially at the whim of the developer of the application. The resource fork -must- be in one format - the format defined and maintained by the IIGS Resource Manager. A large number of system resource formats have been defined and published, and individual applications may define and use their own resource formats as well. But the freedom of definition extends only to the bounds of each resource - the resource manager is reponsible for the creation, deletion, reading and writing of resources and the structure of the resource fork. What are resources used for? Many items in the toolbox can be defined with data structures in resources; This means a program's appearance and behavior may be modified simply be modifying the resources. For example, you can localize a program simply by editing all the string resources - rather than having to go into the source code and "search and destroy" all strings. And because many resource types are standardized, third party resource editors can be used to edit other programs. Andy Stadler Apple Computer, Inc.