On 3/15/07, John Foust <jfoust at threedee.com> wrote:
If you don't have file(1) and you don't have
filename extensions,
what do you have? A lot of files that you don't know what they are
unless you can look inside.
Sounds like what we had on the PET and VIC-20 and C-64. Commodore DOS
(the one built into the ROMs of the IEEE-488 and IEC disk drives)
allowed freeform names, and recognized 4 file types - PRG for "program
file", meaning that the first two bytes were going to be a load
address in memory for the remainder of the file, SEQ for "sequential
file", meaning unformatted data, text, whatever, REL for "relative
file", a sort of chained file that was useful for simple
record-oriented files like databases, and USR for "user-defined file",
meaning whatever you wanted it to mean. You could read and write
sequential bytes in a PRG file or load an SEQ file or whatever; only
the REL files were special to the ROMs. The various file types _did_
have default actions (load, read...), but could be overwritten by
changing the string going to the OPEN call.
Even though much older OSes had extensions long before the 2040 disk
drive, extensions weren't used often in the Commodore world outside of
assembly programming (where one saw the usual FOO.ASM, FOO.LST,
FOO.OBJ patterns). BASIC programs were never (to my experience)
written as FOO.BAS, and machine language patterns weren't known as
.COMs or .EXEs or even .BINs. Just whatever name you wanted as long
as it didn't have certain characters embedded in it (and the cursor
control/color switching characters _were_ allowed!)
When I got to use a UNIX machine and found file(1), that was _such_ an
improvement. I stil l don't like OS-enforced extensions, but I've
lived with them under VMS, OS/8, RT-11, DOS, etc. However,
extensionless OSes are the minority, I think.
-ethan