www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/04/14/10:59:25

Message-Id: <m10XR79-000S8IC@inti.gov.ar>
Comments: Authenticated sender is <salvador AT natacha DOT inti DOT gov DOT ar>
From: "Salvador Eduardo Tropea (SET)" <salvador AT inti DOT gov DOT ar>
Organization: INTI
To: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>,
djgpp-workers AT delorie DOT com
Date: Wed, 14 Apr 1999 12:02:36 +0000
MIME-Version: 1.0
Subject: Re: Stack in djgpp
References: <m10X9m5-000S8aC AT inti DOT gov DOT ar>
In-reply-to: <Pine.LNX.3.93.990414111853.4257C-100000@acp3bf>
X-mailer: Pegasus Mail for Windows (v2.54)
Reply-To: djgpp-workers AT delorie DOT com

Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de> replied:
> 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.

Ok, so what's the best in this case:
1) Add conditional compilation stuff (makes the code harder to understand)
2) Implement spawn and make it conditional (taked from libc in DOS or the 
emulation under Linux).
 
> > 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. 

Looks like it was accident, so then UNIX will release the space when the file 
is closed?
Should djgpp behave like this. I mean: unlink checks in the list of opened 
files, if the file is open it just sets a flag (not call) and then in close 
check this flag and if needed remove the file... hmmm can be implemented, 
don't know if that's really needed.

SET 
------------------------------------ 0 --------------------------------
Visit my home page: http://welcome.to/SetSoft
or
http://www.geocities.com/SiliconValley/Vista/6552/
Salvador Eduardo Tropea (SET). (Electronics Engineer)
Alternative e-mail: set-soft AT usa DOT net set AT computer DOT org
ICQ: 2951574
Address: Curapaligue 2124, Caseros, 3 de Febrero
Buenos Aires, (1678), ARGENTINA
TE: +(5411) 4759 0013

- Raw text -


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