Spaces in filenames (was: shell script question)
Jason Stephenson
jason at sigio.com
Tue Jan 21 13:35:53 EST 2003
Been there, done that, was given the t-shirt. (Yeah, at a previous place
of employment, management gave us in the software development dept.
t-shirts to commemorate shutting down the mainframe.)
I've had to write code that could interoperate with that beast and the
UNIX servers and AS/400 systems. I know all about limitations of dealing
with different operating systems. I've had to write code that handles
files from many vendors each with their unique interpretation of the
same file format. I've written proggies that shuffle data from one
machine to another. I know all about programming portably. I know all
about programming in the real world. I've given up far too many hours of
my life dealing with these issues, this is why I'm so adamant.
I reiterate, that was NOT the topic of the discussion.
If you want to reliably interoperate with every crapy OS ever written,
then you limit file names to 6 alpahnumeric characters with no
extensions and a flat file system with no directories. But THAT IS NOT
WHAT THE DISCUSSION WAS ABOUT!
None of that changes the fact that shell scripts on a POSIX-conforming
system that do not properly handle file names with spaces are broken.
Yes, you may have constraints that may cause you to specify that file
names cannot contain spaces. That's fine. If given that requirement, I
would still write the software so that it worked properly when file
names do contain spaces, because "in the real world" you never know when
you are going to be given input that doesn't conform to your standard.
Anyway, it is no extra effort to support spaces in file names, and a
script that properly handles file names with spaces still properly
handles those without spaces. It is simply laziness (or ignorance or
forgetfulness) that stops a programmer from typing the double quote
character.
I still agree with Ben. Spaces in file names are not evil. Poorly
specified and shoddily implemented applications are EVIL.
That is the last I'm saying on this topic. I should really get something
serious done today, and I'm starting to suspect Derek of trolling me. :-)
Derek Martin wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Tue, Jan 21, 2003 at 12:44:01PM -0500, Jason Stephenson wrote:
>
>>Yes, so?
>>
>>I'm not talking about D[r]OS[s]. I'm talking about POSIX-conforming
>>operating systems, i.e. *real* operating systems. ;-) Specifically,
>
>
> Sure, but in the real world, you may have to interoperate with other
> kinds of systems. This may require you place additional restraints
> other than those that your favorite operating system requires.
>
> - --
> Derek D. Martin
> http://www.pizzashack.org/
> GPG Key ID: 0xDFBEAD02
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.0.7 (GNU/Linux)
>
> iD4DBQE+LYp/HEnASN++rQIRAjU/AJ0X8j1OP52qQdSdXCJb8UL02qZ8igCXTuOD
> j6EVPDiIg4u7+7aV3Wv3AQ==
> =9CmF
> -----END PGP SIGNATURE-----
> _______________________________________________
> gnhlug-discuss mailing list
> gnhlug-discuss at mail.gnhlug.org
> http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss
>
More information about the gnhlug-discuss
mailing list