delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2008/09/22/00:17:50

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Recipient: djgpp AT delorie DOT com
Date: Mon, 22 Sep 2008 00:14:18 -0400
From: Ethan Rosenberg <ethros AT earthlink DOT net>
Subject: Re: Exiting from system()
In-reply-to: <9af855b0809210048h192a03b2s7f350ae2dcb61541@mail.gmail.com>
To: djgpp AT delorie DOT com
Message-id: <0K7K00JTUX4VORE0@mta3.srv.hcvlny.cv.net>
MIME-version: 1.0
X-Mailer: QUALCOMM Windows Eudora Version 7.1.0.9
References: <0K7J008HL7GIRYO0 AT mta4 DOT srv DOT hcvlny DOT cv DOT net>
<9af855b0809210048h192a03b2s7f350ae2dcb61541 AT mail DOT gmail DOT com>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

At 03:48 AM 9/21/2008, you wrote:

>On Sun, Sep 21, 2008 at 8:02 AM, Ethan Rosenberg 
><<mailto:ethros AT earthlink DOT net>ethros AT earthlink DOT net> wrote:
>Dear List -
>
>Thanks for all your excellent help in the past.
>
>I wish to write the following type of program:
>
>#include <stdlib.h>
>#include <stdio.h>
>
>int main(void)
>
>{
>        system(prog1);
>        system(prog2);
>
>}
>
>If prog1 terminates with an exit value of 1, which will indicate an 
>error condition in prog1, I do not wish that prog2 should run.  How do I do it?
>
>Thanks again.
>
>Ethan Rosenberg
>
>
>int main(void)
>{
>    if (system(prog1) == 0)
>       system(prog2);
>}
>

Gerrit -

Wonderful, it works.

Thank you ever so much.

Now I do not have to "baby sit" my computer while it analyses 115 data files!

Ethan 


- Raw text -


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