delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/02/04/04:05:36

Date: Wed, 4 Feb 1998 11:04:29 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: "John M. Aldrich" <fighteer AT cs DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: System crashing - system( "readme.txt" );
In-Reply-To: <34D7B477.6F21@cs.com>
Message-ID: <Pine.SUN.3.91.980204110411.25149K-100000@is>
MIME-Version: 1.0

On Tue, 3 Feb 1998, John M. Aldrich wrote:

> Looking in the source code for system() doesn't entirely resolve this
> question, but it's decidedly bad behavior.  In any case, I see no
> internal check for a command's validity before attempting to run it.

`system' cannot simply check for file's executability because some
text files, like shell scripts and batch files, are actually
executable, and `system' supports their ``invocation''.  Testing
executability would restrict the applications where some non-standard
shells are used.  I think it is the responsibility of an application
to create a valid command line before it passes it to `system', since
only the application has some knowledge of the problem context within
which this issue can be correctly resolved.

It would be swell if DOS and Windows would check the ``program'' file
before they load it and jump into the blue, but they don't.

- Raw text -


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