Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10 5/3/83; site cvl.UUCP
Path: utzoo!linus!decvax!harpo!seismo!rlgvax!cvl!joe
From: joe@cvl.UUCP (Joseph I. Pallas)
Newsgroups: net.unix-wizards
Subject: Re: Funny characters in filenames
Message-ID: <520@cvl.UUCP>
Date: Wed, 27-Jul-83 23:59:48 EDT
Article-I.D.: cvl.520
Posted: Wed Jul 27 23:59:48 1983
Date-Received: Thu, 28-Jul-83 22:00:35 EDT
References: <317@packet.UUCP>
Organization: U. of Md. Computer Vision Lab
Lines: 33

Why, pray tell, are you using system() to do what you're doing?  It
seems grossly unfair to blame the UNIX (tm) system for your misusage of
one of its facilities.  Clearly, if you'd already run into problems
with quoting filenames, you should have been using fork/execv.  If that's
not good enough, then execvp, which gives all the power that system()
does for finding your command, WITHOUT doing what you didn't want it to
do.  Furthermore, it's more efficient.  System() does exactly what the
manual says:  "pass a command to the shell."

On the other side, I've seen lots of problems with naive users making
files they can't seem to remove, because they start with spaces, or
contain (this was the most common) '^[[D' (the left arrow key on most
of our terminals).  I've heard about a no-funny-file-names mode that
some people have implemented, which wouldn't put space, control chars,
or meta chars (8th bit set) into file names.  I'm sure that the 'bad'
characters you mention could be included.  The idea goes against my
grain, but then, I'm not a neophyte.  My solution to our problem was
simply to turn on ctlecho in the tty driver in everyone's .login
(4.1bsd).  Usually, someone has to work hard to create filenames that
contain a semicolon, a slash, or a bracket.  When he does, he
generally has to ask for help to get rid of them.  That seems alright
to me.  Because he'd probably have to ask for help anyway for an
explanation of the funny error he would get in novice-mode.

One other thing...why does expanding your quoting mechanism to quote
all files instead of certain ones "take more system calls to do the
same work,"  when it seems to me that it should use the same number of
system calls in the shell, and be more efficient in your program (no
tests for special characters)?


Joseph Pallas
rlgvax!cvl!joe