delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/04/09/05:33:16

From: firewind <firewind AT metroid DOT dyn DOT ml DOT org>
Newsgroups: comp.lang.c,comp.os.msdos.djgpp
Subject: Re: Executing a program and obtaining its return value
Date: Wed, 8 Apr 1998 21:15:30 -0600
Organization: All USENET -- http://www.Supernews.com
Lines: 23
Message-ID: <Pine.LNX.3.95.980408211218.234B-100000@metroid.dyn.ml.org>
References: <352C1A0D DOT 77EAB402 AT codex DOT nu> <352C2306 DOT 2F72 AT cs DOT com>
NNTP-Posting-Host: 22584 AT 209 DOT 12 DOT 189 DOT 41
Mime-Version: 1.0
In-Reply-To: <352C2306.2F72@cs.com>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

On Wed, 8 Apr 1998, John M. Aldrich wrote:

> system()'s return value is the program's exit code.  If this doesn't
> seem to work for you, post a small example that demonstrates it.  I have
> done it myself with success.

Well, almost; system() returns whatever the command processor returns, which
may or may not be what the executed program returned. MS-DOS's 'command.com,'
for instance, is infamous for providing not-quite-accurate return codes.

> There are two major problems.  The first is that the program's exit code
> is only 8 bytes in the operating system, 

It is? How do you know? (Oh, wait-- this is a crosspost. Nevermind. :)

-- 
(initiator of the campaign for grumpiness where grumpiness is due in c.l.c)

Attempting to write in a hybrid which can be compiled by either a C compiler
or a C++ compiler produces a compromise language which combines the drawbacks
of both with the advantages of neither.
    -- John Winters <john AT polo DOT demon DOT co DOT uk> in comp.lang.c 

- Raw text -


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