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 X-Sender: broeker AT acp3bf To: djgpp-workers AT delorie DOT com Subject: Re: Stack in djgpp In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Precedence: bulk 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.