9fans archive / 1998 / 04 / 22 / prev next
From: Tom Duff td@pix...
Subject: [9fans] allowing space (ASCII 0x20) in file names
Date: Wed, 8 Apr 1998 10:45:42 -0700
On Apr 8, 1:08pm, Russ Cox wrote:
> Subject: re: [9fans] allowing space (ASCII 0x20) in file names
> intro(5) says "Plan 9 names may contain any printable character
> (that is, any character outside hexadecimal 00-1F and 80-9F) except
> slash and blank", so yes it looks like the idea is to disallow
> unprintables.
>
> i don't know the official reasons that space isn't allowed,
> but in general file names with spaces (which you have to deal
> with in Unix and Windows) are a pain for oodles of reasons. the most
> noticeable one is that it messes up scripts and the like:
> ls -l | awk '{print $10}' is no longer guaranteed to give
> you filenames.
Yes, this is certainly the reason. When I was working on the
plan 9 shell, I did a survey of all the file names on all the
unix machines that I could conveniently look at, and discovered,
unsurprisingly, that characters other than letters, digits,
underscore, minus, plus and dot were so little used that
forbidding them would not impact any important use of the
system. Obviously people stick to those characters to
avoid colliding with the shell's syntax characters. I suggested
(or at least considered) formalizing the restriction, specifically
to make file names easier to find by programs like awk.
Probably rob took the more liberal road of forbidding del, space
and controls, the first because it is particularly hard to type,
and the rest because, as Russ noted, they confound the usual
line- and field-breaking rules.