Unix file extensions (Was: make apache2 serve file as htmL...)

Christopher Browne cbbrowne-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Fri Jan 12 21:46:10 UTC 2007


On 1/12/07, John Macdonald <john-Z7w/En0MP3xWk0Htik3J/w at public.gmane.org> wrote:
> On Fri, Jan 12, 2007 at 04:40:24PM +0000, Christopher Browne wrote:
> > [...]  (Aside: People seem to keep forgetting that
> > Unix has NO SUCH THING as a "file extension."  It's not MS-DOS.  It's
> > not VMS.  It's not MVS.  All of those systems had special portions of
> > filenames known as an "extension."  Unix doesn't do that.)
>
> Unix, the operating system kernel, has no special meaning or
> support for file extensions.  It does, however, permit users
> to use any conventions they like to organize their files.  The
> only rules enforced by the operating system about file names are:
>
> - no slash in a file name (reserved for directory separator)
> - no null in a file name (reserved for string terminator in system calls)
> - "." and ".." are reserved for directory layout
> - each type of file system has its own additional limitations, in particular
>     the maximum length of a file name is a property of the particular file
>     system type
>
> On the other hand, Unix, the programming environment, has always
> made use of file extensions to manage files.  The compiler,
> linker, and make, for example, all use extensions in a
> consistant way to specify types of files used for programming.
> The ls program uses file names that begin with . (i.e. contain
> only an extension) to denote files that are, by default,
> not listed.

I'm afraid my copy of Lion's Commentary is at home, so I can't do the
pedantic "see, extensions have *never* been supported," but I believe
I've checked that...

The Unix programming environment has *never* used file extensions.  It
can't, because the filesystems don't support them.

> The concept "you have no NEED to use extensions in Unix"
> is useful for people to know.  However, any phrasing of that
> concept that implies "you should not use extensions in Unix"
> is just plain wrong.  So, be careful about how urgently you
> present that message.

No, it's not "plain wrong."

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."

http://en.wikipedia.org/wiki/Filename_extension
-- 
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