Kernel Hacks & Weird Filenames

John Chambers jc at minya.UUCP
Sun May 1 11:50:07 AEST 1988


| it is pretty silly to allow non-printable characters in a filename.

Silly, perhaps, but also sometimes necessary.

I am reminded of a project a couple years back, that consisted of 
writing code to be downloaded onto a single-board computer (which
shall mercifully remain nameless).  The board came with a tiny
ROM monitor of a common sort:  It had two serial ports, into which
you were supposed to plug cables leading to a terminal and to a
computer.  You could enter the usual sort of debugging commands
from the terminal, to display or alter memory, set breakpoints,
start running from an address, and so on.

There was also a download command.  You typed something like
	DL <command>
and the <command> would be sent out the other port to the computer,
which would do something interesting with it.  If it was a Unix
system, you would type something like:
	DL cat foo.obj
where foo.obj was a file full of the appropriately-encoded data
records.

The fun thing with the DL command was that, before sending the
<command>, it sent a ^X (CTRL-X) character.  So if you typed the
above 'cat' command, what Unix saw was:
	^Xcat foo.obj

Ignore the silliness of this strange behavior; we just had to live
with it.  How we handled it was very straightforward.  We had a
download shell script whose name was "^X".  We could then just
type
	DL  foo.obj
and the script would be downloaded.  (Note the TWO spaces; you can
probably imagine how often we typed only one :-).

Without the ability to include a ^X in the filename, we would have
had to write a special program to read the input and strip out the
garbage character.  Not a big deal, perhaps, but then, every little
barrier put in your way just makes the job harder.  We appreciated
the fact that Unix wasn't fazed by a funny character in the file
name.

The world has lots of systems that can't handle simple things like
filenames with weird characters.  One of Unix's strengths is that
it generally doesn't impose silly restrictions.  Let's keep it that
way.

-- 
John Chambers <{adelie,ima,maynard,mit-eddie}!minya!{jc,root}> (617/484-6393)



More information about the Comp.unix.wizards mailing list