delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/02/19/15:13:55

Date: Mon, 19 Feb 2001 22:12:07 +0200
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: "Tim Van Holder" <tim DOT van DOT holder AT pandora DOT be>
Message-Id: <3405-Mon19Feb2001221207+0200-eliz@is.elta.co.il>
X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.6
CC: djgpp-workers AT delorie DOT com
In-reply-to: <CAEGKOHJKAAFPKOCLHDIKELJCAAA.tim.van.holder@pandora.be>
Subject: Re: O_TEMPORARY and unlink()
References: <CAEGKOHJKAAFPKOCLHDIKELJCAAA DOT tim DOT van DOT holder AT pandora DOT be>
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

> From: "Tim Van Holder" <tim DOT van DOT holder AT pandora DOT be>
> Date: Mon, 19 Feb 2001 18:33:03 +0100
> 
>      The `unlink' function deletes the file name FILENAME.  If this is
>      a file's sole name, the file itself is also deleted.  (Actually,
>      if any process has the file open when this happens, deletion is
>      postponed until all processes have closed the file.)
> 
> Seems to me that this fits in nicely with the O_TEMPORARY support

We discussed a possibility of supporting this, but it has too many
problems.  For example, if a child program unlinks a file which is
open by in the parent.

On Unix, this magic is on the OS, so it works there.

You can find the discussion in the archives of djgpp-workers.

> (although well-behaved programs will usually close a file before
> unlinking it).

If you unlink an open file on DOS, you run a real risk of corrupting
the FAT.  On Windows 9X it simply fails, while NT (and probably W2K as
well) work like Unix.

- Raw text -


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