Mail Archives: djgpp/1995/11/07/01:02:39
On Mon, 6 Nov 1995, A.Appleyard wrote:
> If a program does this:-
> int i = system("MIAOW");
> /* MIAOW.EXE is a program that runs and then exits with fault code N */
> How can the Gnu C/C++ program find the error code that MIAOW.EXE returned?
Don't use system(), use spawn* family of the library functions. They
will return the exit status of MIAOW.EXE (should be a number, but in this
case it could sound like a cat ;-), or a negative number if MIAOW
couldn't be run (like when COMMAND.COM says ``Bad command or filename'').
- Raw text -