On 8/29/06, Chuck Guzis <cclist at sydex.com> wrote:
Unix was the first system that I'd ever seen where
the file name implied a
type.
It was common on systems I'd seen before I started using UNIX around 1984,
such as RT-11 (MYPROG.SAV, MYFILE.TXT...), RSX-11 (similar examples),
and even OS/8 (MYPROG.SV, MYFILE.TX...) UNIX was the second system
that I ran into that didn't enforce a dot and a file extension in the name (even
though many tools _respected_ extensions) - the first was the Commodore
PET and descendents (VIC-20, C-64...). Nobody (that I ever saw) used
extensions on tape files, and the same went for files on floppy (unless you
happened to be using the Commodore Assembler, in which case, the
*application* wrote files with a dot and an extension. Nevertheless, the
diskette filesystem had no concept of an extension - it allowed you 16 arbitrary
characters in the filename.
There are very old systems that differentiate between
'data" and
"executable" files outside of the file name; it can be via attribute or
"type" not part of the file. Unix is one such system--you can have a
"Can't read or write, only execute" file.
Commodore DOS does this (starting with the model 2040 dual-5.25" diskette
drive in the late 1970s[1])... there was a byte in the directory entry
outside of
the filename that tells the drive-based DOS what type of file (PRG for
program, SEQ for a sequential data file, REL for relative (random access)
data file, USR for user-defined type, and, behind the scenes, DEL for
deleted data (not displayed through normal directory commands).
The file types are somewhat arbitrary, in that one can save sequential data as
a type PRG (by opening the file with something like 'open
1,8,1,"0:MYDATA,P"'),
which might sound less than useful, but it's just the thing for a
compiler to do -
open a PRG-type file for writing and stuff the file full of instructions.
Essentially, the only real difference between a PRG and an SEQ is that if you
try to load a PRG, there'd better be a 2-byte load address at the
front. I don't
_think_ you can tell CBM BASIC to load an SEQ file, but if 'load
"0:MYPROG,S"'
works, then that's how you'd do it. One can also write a simple tool
in BASIC or
assembler to open the diskette, read a directory block into a buffer onboard the
drive, send commands to change drive memory ("M-R"), then write the block back
out to the floppy, changing the file type byte. It's not magic, and
it won't break the
filesystem.
So that's how one "bittybox" does it... it's just part of the
filesystem that you can
use as intended or go around. Not everyone does it the MS-DOS or the UNIX way
(RT-11 is another good counter-example for that, but I'll leave it for
another time).
-ethan
[1] -
http://en.wikipedia.org/wiki/Commodore_DOS