Date: Wed, 4 Feb 1998 11:04:29 +0200 (IST) From: Eli Zaretskii To: "John M. Aldrich" cc: djgpp AT delorie DOT com Subject: Re: System crashing - system( "readme.txt" ); In-Reply-To: <34D7B477.6F21@cs.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk 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.