www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/04/14/16:18:02

From: Alain Magloire <alainm AT rcsm DOT ece DOT mcgill DOT ca>
Message-Id: <199904142017.QAA10920@mccoy2.ECE.McGill.CA>
Subject: Re: Stack in djgpp
To: djgpp-workers AT delorie DOT com
Date: Wed, 14 Apr 1999 16:17:55 -0400 (EDT)
In-Reply-To: <m10XV4a-000S7QC@inti.gov.ar> from "Salvador Eduardo Tropea" at Apr 14, 99 04:16:13 pm
X-Mailer: ELM [version 2.4 PL25]
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

Bonjour M. Salvador Eduardo Tropea

> 
> I told the father is waiting, no IPC, no real multitask.
> 

Then popen()/spawn()/system() should do fine.  I don't know if he needs
the return status code.  I vaguely remember that spawn() was part of
an early POSIX draft but never made it to the standard.  So maybe trying
with portable stuff like popen()/system() is a gain.

> 
> > > > > 2) The author also does it:
> > > > > 
> > > > >     yyin = fopen(preOutName,"r");
> > > > >     unlink (preOutName); 
> > > > >     if (yyin == NULL) {
> > > > > 
> > > 
> > > Looks like it was accident
> > 
> > This is no accident but common use.  
> 
> The author told me he didn't want to do it.

?? meaning that it was autogenerated via bison, flex or whatever
This is common pratice not only for temp files but for security reasons,
cleanup, .... If it is only for temp files then a portable way
could be FILE * tempfile(void);

> > 
> > You mean some sort of reference count.  This will not work if you
> > don't have support from the OS.
> 
> It will work, but not 100% equal, at least the file will be removed. In Win95 
> the unlink of an opened file fails so doing what I say the file will be 
> deleted and the program will work. In DOS there is no solution.
> 

I meant, if someone start a comand.com shell and erase the files you'll
have chaos.  It may work within DJGPP env. since the environment/lib
will maintain a consistent view for you.  That may not be acceptable
for certain people/application.

-- 
au revoir, alain
----
Aussi haut que l'on soit assis, on est toujours assis que sur son cul !!!

- Raw text -


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