X11R4 from wustl "can't ioctl(): Invalid argument"

Robert Minich minich at d.cs.okstate.edu
Sun Oct 7 15:42:48 AEST 1990


by rmtodd at servalan.uucp (Richard Todd):
> The reason is that AFE is a MacOS program, and that "default header" is the
> resource and info forks of a MacOS style file.  I don't know if you're
> familiar with the MacOS concept of file forks; basically, like Gaul, MacOS 
> files are always divided into 3 parts, an info fork (which records various
> bits of status for benefit of the Finder, I believe), a resource fork
> (read Inside Mac for all the sorts of things this part can contain, it's
> really too complicated to go into here) and the data fork (just ordinary 
> sequential file like most systems have).  Since A/UX, like all other Unix
> systems, have only normal, single-forked files, there has to be a standard
> way to "include" the resource and info forks of a file when storing a MacOS
> file on a Unix filesystem.  Actually, there are two ways, but files created
> by MacOS programs always are in the first format, AppleSingle.

  This is not particularly helpful for the original problem, but I didn't want
anyone thinking "Hmm, a MacOS file is a really screwed up thing." There are
TWO (not three) forks. The "info fork" is actually info on the file as a whole,
kept by the file system, like last modification date, name of the file, etc.
(By Richard's explanation, one could call a UNIX file two-forked!)
  The data fork is just your typical linear byte stream. The resource is not a
stream (as presented to a Mac app) but a set of tagged data chunks. These
chunks typically are things like icons, text strings, window templates, code
segments, sounds, etc. Each chunk has a type, an ID number, a name, and some
flags. The type is a 32bit quantity typically viewed as four characters.
('CODE', 'MENU', 'snd ', ...)  This way you can make a call like:

	myobj = GetNamedResource('DATA', "\pTranslation Table");

and not worry about the underlying structure of the resource file itself.
(This is the job of the [gasp] Resource Manager.) One of the near things
about the resource fork is the ability to edit user interface portions of
a program without recompiling. You can also translate to you favorite
vernacular! 
  I'm not aware of exactly what the definition of AppleSingle format is but
I suspect it is just "MacBinary", a format developed to facilitate the use
of BBS's for exchanging Mac files. The idea is that you wrap both forks
and some of the system info about the file in one chunk and present that
to your host as a single file. When downloading, a Mac comm program will
recognize the MacBinary format and unwrap the file on it's way to the disk.
-- 
|_    /| | Robert Minich            |
|\'o.O'  | Oklahoma State University| A fanatic is one who sticks to 
|=(___)= | minich at d.cs.okstate.edu  | his guns -- whether they are 
|   U    | - Ackphtth               | loaded or not.



More information about the Comp.unix.aux mailing list