delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/01/29/06:27:27

From: benny AT crocodial DOT de (Benjamin Riefenstahl)
Subject: Re: Problems with mingw32 GCC 2.8.0 !!!
29 Jan 1998 06:27:27 -0800 :
Message-ID: <34D05948.183037BA.cygnus.gnu-win32@crocodial.de>
References: <Pine DOT SOL DOT 3 DOT 95 DOT 980128150708 DOT 11882A-100000 AT gort>
Mime-Version: 1.0
To: Fabio Vignoli <bafio AT dist DOT unige DOT it>
Cc: Jan-Jaap van der Heijden <janjaap AT Wit381304 DOT student DOT utwente DOT nl>,
GNU-Win32 list <gnu-win32 AT cygnus DOT com>,
Colin Peters <colin AT bird DOT fu DOT is DOT saga-u DOT ac DOT jp>

Fabio Vignoli wrote:
> Just to joke:
> try in a MSDOS shell on windows NT : cd Program Files (it works)
>                                      cd "Program Files" (it works)
>                                      dir Program Files (DOES NOT WORK!!!)
>                                      dir "Program Files" (it works)
> Does anybody can tell me why?

;-)

If I had to guess I'd say it's just programmer's laziness and probably
backwards compatibility afterwards. You have to remember that in
DOS/Windows the command line is not parsed by the shell but by the
programs themselfs. That makes for a lot of inconsistencies between
applications and commands and seemingly even between command.com
built-ins.

The story probably was: The cd command has no options (or at least it
didn't use to), so the programmer of command.com did not bother to parse
the command line, he just took it and used it as a whole. In later
versions he added code to strip the quotes for compatibility with other
commands but he didn't use the full command-line parser, because that
might not have been backwards compatible with the use of the cd command
in older batch scripts. The dir command OTOH has a lot of options, so
the command line *has* to be parsed and after parsing Program Files
becomes two arguments.

All just guesswork, of course ;-)
======================================
Benjamin Riefenstahl (benny AT crocodial DOT de)
Crocodial Communications EntwicklungsGmbH
Ophagen 16a, D-20257 Hamburg, Germany
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019