I was kind of taking the simplistic view that each
file had a
standard sized header that at least had a magic number* and some
indication of length of said file.
I don't know of any OS that has such a thing. Not even VMS, which
generally speaking has file type stuff out the wazoo - unless your
"magic number" can be read as applying to the FDL description of the
file's layout.
*osf1/tru64 files have a magic number in the header
that describes
the file type which you can determine with the 'file' command.
Um, you need to learn more about how file(1) works. There is a
moderately large database of "this kind of file exhibits these data
patterns"; file(1) uses that and pokes around in the file's contents to
see which of those patterns the file matches. There is no
type-independent header such as you are imagining; rather, the
type-dependent headers for the various recognized file types are
recognized. (file(1) actually has some additional heuristics for
identifying things like C code that don't have magic-number headers,
but they're just that, heuristics.)
/~\ The ASCII der Mouse
\ / Ribbon Campaign
X Against HTML mouse at rodents.montreal.qc.ca
/ \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B