[comp.sys.ibm.pc] pathnames: MISSING THE POINT!

riml@softart.UUCP (Research in Motion Limited) (02/21/89)

[Considerable verbiage about forward and back slashes NOT repeated]
 
It appears that some posters have missed the point about allowing
BOTH forward and back slashes in a file specification.
 
DOS DOESN'T CARE.  The shell does, and DOS commands use SWITCHAR as
the switch character (which causes problems if it is '/'), but the
low-level DOS uses EITHER ONE.  Try it and see if you don't believe it.
 
Many people use other shells, such as the MKS korn shell.  For this
shell the path delimiters are forward slashes, especially in
environment variables.
 
However, some DOS programs start off by assuming backslashes for
path delimiters.  If they are trying to construct a path to a
pre-determined set of subdirectories, they may prepend or append
an extra path section onto these variables, or onto a pathname
specified on the command line with forward slashes.
 
This will construct a complete path THAT CONTAINS BOTH FORWARD AND BACK
SLASHES.  If they then parse this pathname, and they don't understand
both delimiters, the program will not function as expected.
 
The question of which delimiter to use for the "switch" character
should have nothing to do with which is used in the path.  There is
no whitespace surrounding the delimiter when it is used in a path.
Since the normal UN*X command line parsing conventions assume that there
is AT LEAST ONE WHITESPACE CHARACTER between an argument and the next
switch character, this provides an easy way of telling the difference.
 
There.  I've said my piece.  Flames would be silly :-)
 
Michael A. Barnstijn
V.P. Software Systems           USENET: ...!uunet!watmath!softart!riml
Research In Motion Limited      PHONE:  (519) 888-7465
Suite 6, 465 Phillip Street, Waterloo, Ontario, Canada  N2L 6C7
My opinions sometimes reflect my company's opinions, and sometimes not.
It depends on how many shares I have at the time :-)

dhesi@bsu-cs.UUCP (Rahul Dhesi) (02/24/89)

In article <51@softart.UUCP> riml@softart.UUCP (Research in Motion Limited)
writes:
>It appears that some posters have missed the point about allowing
>BOTH forward and back slashes in a file specification.
> 
>[MS-DOS] DOESN'T CARE.

Exactly.  I suggest the general programming philosphy:

     Don't second-guess the operating system.

If MS-DOS will accept a pathname, your program should not prevent its
use.
-- 
Rahul Dhesi         UUCP:  <backbones>!{iuvax,pur-ee}!bsu-cs!dhesi
                    ARPA:  bsu-cs!dhesi@iuvax.cs.indiana.edu