Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!caen!spool.mu.edu!news.cs.indiana.edu!widener!iggy.GW.Vitalink.COM!pacbell.com!tandem!zorch!amiga0!mykes From: mykes@amiga0.SF-Bay.ORG (Mike Schwartz) Newsgroups: comp.sys.amiga.programmer Subject: Re: ResEdit for the Amiga? Message-ID: Date: 6 Jun 91 01:15:34 GMT Article-I.D.: amiga0.mykes.3180 References: <231b3678.676013157@fergvax> <53626@apple.Apple.COM> Organization: Amiga makes it possible Lines: 62 In article <53626@apple.Apple.COM> farrier@Apple.COM (Cary Farrier) writes: >In article <231b3678.676013157@fergvax> 231b3678@fergvax.unl.edu (Phil Dietz) writes: >>If you didn't know, the MAC resources that ResEdit uses, are simply a >>header at the start of a program. All ResEdit does is load the >>header of a file, lets the user change the values, then re-saves. >> ^^^^^^^^ > >No, they aren't. The macintosh files are composed of two distinct >parts, the data fork and the resource fork. All of the resources >(such as window parameters, icons, etc.) are saved in the resource fork >as discrete records that are accessed through operating system code >in a fashion similar to a database. The program code is also saved >as a resource. The resource fork and data fork are actually two >physically different files in terms of sdisk information, but are >accessed via the same file. > >ResEdit accesses these resources through the OS, it doesn't just >"change a header" at it's own discretion. You are both right. The Mac logically supports two forks to each file, but physically it is ONE file with the information at the front as described. The OS provides a consistent set of routines for manipulating the data at the front of the file. When you add stuff to the resource fork of your system file, the finder tells you that the whole file gets bigger, because it is ONE file. >> >>One side-effect of having these resources at the head of a file is that >>the program you are editing is being tampered with. If a person changes >>a value to a bad value, the whole program is ruined (as a Mac's System >>seems to do often). > >You seem to be under the impression that the >file's object code is being tampered with. That is not the case, I suggest you >read a copy of Inside Mac volumes 1-3 and get familiar with the concept of resources. I don't intend that to sound like a flame, just a suggestion. Resources are a >pretty good idea, and they make >programming a heck of alot easier when designing a GUI. > > -- Cary If you check out Inside Mac yourself, you will find that there are routines for reading Mac files as if it were one big file (which is the way it really is). You can open a file and read bytes sequentially and you get the header block first, followed by the data and resource forks (not necessarily that order). In fact, this is how modem software (like ZTerm) reads a mac file to send it somewhere else. When you call a MS-DOS bbs and upload a Mac file to it, someone else can call up and download it intact to his mac later on. It is because the WHOLE file is intact - data and code forks. But more interesting to me is the benefits of resources. People seem to think that the Amiga's methodolgy for handling the GUI is unique to the Amiga. Well, the only thing that makes the Amiga unique is the fact that it DOESN'T have a ResEdit program or Resource compiler. I'm not familiar with the windowing systems under Unix, but I do know that GEM, the MAC, and WINDOWS all support the ability to define data structures for NewWindow (similar to amiga) and call OpenWindow or to put the data structure into a resource and call GetOpenWindow. I agree that a ResEdit application would be nice and Resources would be a great thing to add to the OS. -- **************************************************** * I want games that look like Shadow of the Beast * * but play like Leisure Suit Larry. * ****************************************************