Unix file extensions (Was: make apache2 serve file as htmL...)
Christopher Browne
cbbrowne-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Mon Jan 15 19:56:21 UTC 2007
On 1/14/07, Howard Gibson <hgibson-MwcKTmeKVNQ at public.gmane.org> wrote:
> On Fri, 12 Jan 2007 21:46:10 +0000
> "Christopher Browne" <cbbrowne-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org> wrote:
> >
> > If you examine filesystem code, you'll find that there Is No Such
> > Thing As A File Extension. They don't exist. They aren't supported.
> > (Well, they are in msdosfs and ISO9660, which, respectively, emulate
> > FSes from Microsoft and DEC. But not in the *usual* Unixy
> > filesystems...)
> >
> > Unix programming tools don't use them, either.
> >
> > Unix programming tools often use file suffixes to infer information
> > about file type, but a suffix is not the same thing as an "extension."
>
> Christopher,
>
> It looks like I am going to have to transition from FVWM and the file mananger XFM to the Gnome distributed with Fedora Core_5. It is too bad, since XFM can use magic files to identify stuff. You do not need file extensions.
>
> Progress -- two steps forward, one step back. I hope.
Unfortunately, Nautilus wound up designed (not surprisingly, when
written by Mac folk who expected a "magic number" on their former
platform) to depend on suffix information to identify stuff.
I was unhappy with this, and expressed opinion, at the time.
As you have observed, /etc/magic can be used to provide signatures to
identify stuff, generally with a LOT more accuracy than file
extensions ever offered.
Unfortunately, that accuracy comes at a cost: You have to read
roughly the first 500 bytes of each file in order to match it against
/etc/magic. Which, for a directory with a large number of entries,
means a lot of I/O. That was why the Nautilus maintainers declined to
use /etc/magic by default :-(.
--
http://linuxfinances.info/info/linuxdistributions.html
"... memory leaks are quite acceptable in many applications ..."
(Bjarne Stroustrup, The Design and Evolution of C++, page 220)
--
The Toronto Linux Users Group. Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists
More information about the Legacy
mailing list