"File types"

Don THX1138 at dakotacom.net
Tue Aug 29 10:20:32 CDT 2006


der Mouse wrote:
>>> Unix was the first system that I'd ever seen where the file name
>>> implied a type.
> 
>> By "type", I mean:
> 
>> "This is a photograph"
>> "This is a MSWord 'document'"
>> "This is a TIFF image"
>> "This is a C source file"
>> "This is a C++ header file"
> 
> I don't think Unix file names imply types, though for some types they
> do imply default types.  (Or, to put it another way, they imply types
> in an advisory, not mandatory, sense.)

[I assume at least one of those "types" was intended to be
"file extensions"  :> ]

> (And yes, I realize the above quotes are not from the same person.  In
> fact, the one looks like a response to the other.)
> 
>> E.g., ages ago [...] I could do "asm foo.obj" if I had a perverse
>> sense of humor *and*, as long as "foo.obj" contained valid "src
>> code", the application would process it as such.
> 
>> But, nowadays, systems seem (excepting Macs?) to all tie some
>> significance to the "extensions" tagged onto filenames.  E.g., they
>> gag on files named "MyFile", "ReadMe", etc. because they can't infer
>> the file type from the name (lacking a suitable "extension").
> 
> This does not describe any even vaguely Unixish system in my
> experience.  All of them handle such things just fine - indeed, I have
> a number of plain text documentation files named something.doc on my
> home machines.

Correct.  Because UNIX (i.e. the *OS*) doesn't have a concept
of "file types" (in the sense of this discussion).  That
concept (to the extent present) is something associated with
any desktop *application* running ON TOP OF it.  E.g., if KDE
wants to introduce a concept of a file type to enable a
"click to open (using the "appropriate" viewer for this type!)"
mechanism, then KDE has to assume the responsibility for
managing file type information.

[this fits with my opinion of where the division of labor
should lie between app vs. os]

But, still, even in these *layered* approaches, the file name
has been chosen as the mechanism for conveying type information.
It need not have been (though it looks like the EASIEST way
of doing so).

Again, I see nothing explaining why this evolution occurred
(other than "because folks got used to someone's CHEAP
implementation).  Or, perhaps the behaviour of so many
command line apps, over the years, to *assume* "default"
suffixes for the types of files on which they operated
(to save us the trouble of typing a few extra characters?)
evolved into the *inverse* "convenience" -- letting us tell
the machine what application we want based solely on the name
of the file that we specified (what a perversion!  :> )

Imagine the (cough) elegance of being able to type:
$ foo.c     // to compile foo
$ foo.o     // to link foo
$ foo       // to run foo
(neglecting the means of actually *writing* foo!  :< )



More information about the cctalk mailing list