www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/06/17/10:46:53

From: "Tim Van Holder" <tim DOT van DOT holder AT pandora DOT be>
To: <djgpp-workers AT delorie DOT com>
Subject: Re: Our unlink() isn't POSIX
Date: Sun, 17 Jun 2001 16:47:31 +0200
Message-ID: <CAEGKOHJKAAFPKOCLHDIGEFOCEAA.tim.van.holder@pandora.be>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
In-Reply-To: <Pine.SUN.3.91.1010617143521.12677L-100000@is>
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
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

> > > The results of deleting an open file depend on the underlying
> OS: Windows
> > > NT actually supports the Posix behavior; Windows 9X refuses
> to remove the
> > Does that mean that our unlink/rename follow Posix on NT/2000, or is it
> > simply that NT/2000 supports the behaviour?
>
> The OS does it.  This kind of thing is impossible to provide on the
> application level, for the reasons I explained.

What I meant was: does the libc code stop you, or will it simply pass the
rename call through to the OS (with potentially disastrous results on plain
DOS, and Posix behaviour on NT/2000)?

> > before the cleanup function (on Win32, _fcloseall() is used,
> which I assume
> > does mainly the same thing).
>
> We have a similar function, but I don't see how would this help you with

Oh - I checked the libc reference but couldn't find one - so I went with
a loop (seemed safe enough).

> > +The @sc{posix} specification requires this removal to be
> delayed until the
> > +file is no longer open.  Because this is not feasible on most systems
> > +supported by DJGPP (Windows NT and 2000 being the exceptions), this
> > +implementation of @code{unlink} does not fully comply with the
> specs; if
> > +the file you want to unlink is open, @code{unlink} will fail.
>
> Thanks.
>
> The ``unlink will fail'' part is IMHO too vague and might mislead
> someone.  I suggest to describe what happens on each OS, because ``fail''
> is ambiguous.

I know you get EACCESS on Win9x, but I wasn't sure about DOS, NT, etc.

- Raw text -


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