[Coco] coco magic

Willard Goosey goosey at virgo.sdc.org
Fri Jul 24 18:18:51 EDT 2009


I refer, of course, to /etc/magic, the UN*X file that controls the
file(1) program.  No, my CoCo hasn't started throwing fireballs at me,
though it's probably been tempted... ;-)

For non-unix nerds, file is sort of like os-9's "ident"'s big brother.
Since UNIX doesn't have as strong a tradition of using filename
extensions, you'll often end up with a file called foo that you have
no idea what kind of file it is.  Is it a gif?  A program?  An
archive?  File looks inside files for "magic numbers" that are stored
in /etc/magic, and can identify the file.  For instance, the first
bytes of a gif are "GIF8".  Further, subtypes can be determined, such
as GIF87 or GIF89.

Anyway, I've been recording all the CoCo's native file types that I
can into a magic file.  It already had OS-9 & OSK modules.

Admittedly, this is somewhat silly.  Most OS-9 data files get file
extention stuck on them, so the user can say, yeah, that's a gif, just
by looking at the filename!

So far, I have:
DECB .bin (regular and CTRSDOS)
TC3
CUTS
ROF
ar
YM
DB9-90
Dynacalc data
Color Computer Artist
GPLoad
VEF
BASIC-09 source
Level II hlp
OS-9 shell script

And I'd like to find info on:
NitrOS 6309 modules type/language settings
6309 ROF
OS-9 Profile
Sculptor
dshrink
mge
cm3
Home Publisher clipart
Dynacalc spreadsheets
Deskmate 3 file formats
any other CoCo native disk file formats


Things I've learned:
One-byte magic number, especialy 0x00, is a lousy magic number!

Many Coco file formats consist of a header, data, header, data....

Dispite this, most don't have proper magic numbers that specifically
say, "I'm a Color Foobar file".

Extra props to Steve Bjork:  Color Computer Artist files have VERY
good magic!

Micro Illustrator files can be turned into regular PMODE 3 images
simply by merging a .bin header and footer around the original file.

Next time I design a data file format, it will have proper magic
numbers!

Willard
-- 
Willard Goosey  goosey at sdc.org
Socorro, New Mexico, USA
I search my heart and find Cimmeria, land of Darkness and the Night.
  -- R.E. Howard



More information about the Coco mailing list