Mail Archives: djgpp/1998/02/04/04:05:36
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 -