delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/08/20/17:51:04

Sender: nate AT cartsys DOT com
Message-ID: <37BDC97F.609A7CB3@cartsys.com>
Date: Fri, 20 Aug 1999 14:32:47 -0700
From: Nate Eldredge <nate AT cartsys DOT com>
X-Mailer: Mozilla 4.08 [en] (X11; I; Linux 2.2.12pre4 i586)
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Re: What's the difference between system, spawn and exec?
References: <7pdhog$glp$1 AT server DOT noris DOT net> <37BAD5AE DOT A01B904F AT americasm01 DOT nt DOT com>
Reply-To: djgpp AT delorie DOT com

Campbell, Rolf [SKY:1U32:EXCH] wrote:
> 
> Goh Yong Kwang wrote:
> 
> > The functions, system(), spawn() and exec() are used to execute other programs
> > or commands. So what's the difference between them?
> >
> > When should I use system(), spawn() and exec()?
> 
>     You should only use 'exec' when you are writing a program for UNIX, and it is
> only in DJGPP for the purpose of compatability. 

And even so is not very useful without `fork', which DJGPP doesn't have
at all.  `system' is much more portable, so use it whenever practical.

-- 

Nate Eldredge
nate AT cartsys DOT com

- Raw text -


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