Date: Tue, 7 Nov 1995 07:43:18 +0200 (IST) From: Eli Zaretskii To: "A.Appleyard" Cc: DJGPP AT sun DOT soe DOT clarkson DOT edu Subject: Re: Getting the return code of a program called by a Gnu C program 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'').