From: "Tim Van Holder" To: Subject: Re: Our unlink() isn't POSIX Date: Sun, 17 Jun 2001 13:25:49 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 In-Reply-To: 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 Precedence: bulk > 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? In any case, I'll have to stick to the very ugly for (i = 3; i < 256; ++i) close (i); before the cleanup function (on Win32, _fcloseall() is used, which I assume does mainly the same thing). Patch for the docs follows. Index: src/libc/posix/unistd/unlink.txh =================================================================== RCS file: /cvs/djgpp/djgpp/src/libc/posix/unistd/unlink.txh,v retrieving revision 1.2 diff -u -r1.2 unlink.txh --- src/libc/posix/unistd/unlink.txh 1998/09/27 15:22:28 1.2 +++ src/libc/posix/unistd/unlink.txh 2001/06/17 11:23:29 @@ -10,6 +10,11 @@ @subheading Description This function removes a file from the file system. +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. @subheading Return Value @@ -18,6 +23,7 @@ @subheading Portability @portability !ansi, posix +@port-note Not fully compliant with the POSIX specification (cfr. supra). @subheading Example