www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/04/14/05:26:53

X-Authentication-Warning: acp3bf.physik.rwth-aachen.de: broeker owned process doing -bs
Date: Wed, 14 Apr 1999 11:24:32 +0200 (MET DST)
From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
X-Sender: broeker AT acp3bf
To: djgpp-workers AT delorie DOT com
Subject: Re: Stack in djgpp
In-Reply-To: <m10X9m5-000S8aC@inti.gov.ar>
Message-ID: <Pine.LNX.3.93.990414111853.4257C-100000@acp3bf>
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Tue, 13 Apr 1999, Salvador Eduardo Tropea (SET) wrote:

> 1) fork(), the author uses fork just because the command is there, he forks, 
> one thread execs another program and the other waits! why? isn't that the 
> same that spawn(P_WAIT,... ?

Answer in a nutshell: there *is* no 'spawn' on Unix (including Linux).
spawn and friends are a DOSism.

> 2) The author also does it:
> 
>     yyin = fopen(preOutName,"r");
>     unlink (preOutName); 
>     if (yyin == NULL) {
> 
> What's that?! he opens the file and unlinks it. Is that supposed to work in 
> UNIX? I mean: what the program will get from a file that was unliked?

A temporary file that doesn't leave any trace of its existence in the file
system (unlink deletes only the directory entry, if the inode, i.e. the
file itself is still used by someone).  Among other tricks, this means
that no other program will have an opportunity to access that same file,
whether by accident or on purpose. 

Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.

- Raw text -


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