delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/02/04/10:13:43

Date: Wed, 4 Feb 1998 17:10:50 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: G DOT DegliEsposti AT ads DOT it
cc: djgpp AT delorie DOT com
Subject: Re: System crashing - system( "readme.txt" );
In-Reply-To: <C12565A1.002FBBA9.00@vega.ads.it>
Message-ID: <Pine.SUN.3.91.980204170539.26317A-100000@is>
MIME-Version: 1.0

On Wed, 4 Feb 1998 G DOT DegliEsposti AT ads DOT it wrote:

> IIRC system() passes the string to the shell for execution.

Not in DJGPP, it doesn't.  Stock DOS shell is too dumb, so `system' in 
DJGPP's C library does most of the work itself, and only calls the shell 
for commands which are internal to the shell.

> if you try "readme.txt" under command.com you will get "bad command or file
> name" (or something like that).

That's because COMMAND.COM looks at the extension and refuses to run files
whose extension is not one of those it knows about.  Try renaming some
README.TXT into README.COM and type "README.COM [Enter]": DOS will crash. 

DJGPP's `system' cannot restrict itself to only a handful of extensions, 
since it needs to support interpreters such as Unix shells, Awk, Perl 
etc. whose scripts can have arbitrary extensions.

- Raw text -


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