delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/06/19/04:54:56

Date: Tue, 19 Jun 2001 11:56:30 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Tim Van Holder <tim DOT van DOT holder AT pandora DOT be>
cc: djgpp-workers AT delorie DOT com
Subject: Re: Our unlink() isn't POSIX
In-Reply-To: <CAEGKOHJKAAFPKOCLHDIAEGLCEAA.tim.van.holder@pandora.be>
Message-ID: <Pine.SUN.3.91.1010619115603.7390N-100000@is>
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Mon, 18 Jun 2001, Tim Van Holder wrote:

> > > It keeps a table of files it has opened; this table has an associated
> > > cleanup function that unlinks those that need to be removed.  But it
> > > never seems to close those files (or not all of them anyway), resulting
> > > in an error in unlink() (on LoseME anyway).
> > > I've now simply added a call to the stdio_cleanup_proc in those places
> > > where an _fcloseall() was added on Lose32.
> > 
> > Isn't it cleaner to close each file just before it is unlinked?
> > 
> Yes - but the file table keeps only names, not FILE*s/fds.

Yikes!

Can't you switch lclint to use `tmpfile' for those files that should
be automatically deleted?  `tmpfile' is ANSI, so there shouldn't be a
problem to do that when buffered stdio functions are used for I/O.
(The usual nuisance with this defer-delete-until-closed feature is
with unbuffered Unix-style `open'/`write'/`close' I/O.)

- Raw text -


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