delorie.com/archives/browse.cgi   search  
Mail Archives: opendos/1997/05/17/10:14:56

Date: Sat, 17 May 1997 10:04:03 -0400 (EDT)
From: "Mike A. Harris" <mharris AT blackwidow DOT saultc DOT on DOT ca>
Reply-To: "Mike A. Harris" <mharris AT blackwidow DOT saultc DOT on DOT ca>
To: pierre AT tycho DOT com
cc: OpenDOS Mailing List <opendos AT delorie DOT com>
Subject: Re: BIG suggestion for Opendos Features
In-Reply-To: <Pine.LNX.3.95.970507102933.23868A-100000@55-174.hy.cgocable.ca>
Message-ID: <Pine.LNX.3.95.970517094516.276H-100000@capslock.com>
Organization: Total disorganization.
MIME-Version: 1.0

On Wed, 7 May 1997, Pierre Phaneuf wrote:

> On Wed, 7 May 1997 yeep AT xs4all DOT nl wrote:
> 
> > > I'd love full case sensitivity that can be turned off (collisions handled 
> > > through mangling). Case preservation is undiscutable. PLEASE, for the
> > > command-line users among us (that's Open*DOS*, right?), don't let spaces
> > > characters creep in!
> > 
> > If you don't want spaces, don't use them.
> > You can use spaces on EXT2, but I've never seen anybody do it.
> > Well aside from myself then, but I quit doing it, 'cos it sucked big time.
> 
> How do you do spaces in filenames in Linux? How does bash reacts to this?
> And the fileutils (like ls)? Anyway, quoting a filename is losing IMHO, so
> spaces should be out... ;-)

capslock:~# touch "spaced filename"

capslock:~# ls -q

spaced filename

capslock:~# ls -b

spaced\ filename


There you go.  Also, if you press TAB for filename completion, it
"quotes" those filenames for you.  Or else you can escape the
spaces with a backslash.


The problem with spaces in filenames is that:

1) Spaces on the command line are interpreted as argument
delimiters and hence utilities like rm, ls, mv, cp, etc...
interpret a spaced filename as 2 or more separate filenames
unless you quote the filename so it is treated as a single
entity, or escape the spaces with backslashes.

2) Some people don't like having to quote such filenames or
escape them, and hence don't like spaced filenames (myself
included)

3) Some people want spaced filenames, don't want to quote them
and for some strange reason can't understand why the hell they
HAVE NO CHOICE but to quote them. This primarily stems from the
fact that they don't understand the shell OS/FS/shell, and the
way command lines work.  That is their problem, if they use
spaced filenames and don't like quoting, then they can stop using
them, or stay in a GUI.

4) Some people use spaced filenames, like them, and don't care if
anyone else likes them or not.  Since W95 exploits the use of
spaces in filenames, this is not surprizing.

What it boils down to is that, there ARE filesystems that allow
spaces in filenames, and that if an OS is going to allow using
such a filesystem, then it must support spaces in filenames for
that filesystem.  Also, as a result, other programs including the
shells, must also be capable of dealing with any filenames that
come up, and thus quoting or escaping is absolutely necessary.

Therefore we must support the usage of spaces for backwards
compatibility.  However due to the difficulties and headaches
involved with such filenames, their usage should be heavily
discouraged.  Those that adamantly want to use spaced filenames
are going to be stuck having to quote or escape them at the
command line period.  Filename completion will minimize this
somewhat, however quoting is the only way.  Otherwise consider
this:

#ls

filename
spaced
spaced\ filename

#rm spaced filename

What should happen?  Should rm delete "spaced filename" or should
it delete "spaced" and "filename"?  The normal operation of rm
would do the latter, and this is expected behaviour.
Unfortunately, some poor user is going to complain and say "It
SHOULD have deleted "spaced filename".  Well that is not true,
read the documentation on rm.  The arguments to rm are a list of
filenames separated by spaces which are to be deleted.

This whole space thing is rediculous.  One of only 2 outcomes is
going to happen:

1) Spaces will be allowed in filenames and will need to be quoted
or escaped at the command line.

2) Spaces will not be allowed in filenames and filenames
containing spaces in mounted filesystems that allow spaces will
have to be name-mangled.

Any other realistic possible outcomes?

Mike A. Harris        |             http://blackwidow.saultc.on.ca/~mharris
Computer Consultant   |                  Coming soon: dynamic-IP-freedom...
My dynamic address: http://blackwidow.saultc.on.ca/~mharris/ip-address.html
Email: mharris at blackwidow.saultc.on.ca  <-- Spam proof address

Want to know how to let people connect to your computer over the internet?

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019