Mail Archives: djgpp-workers/2001/06/17/07:25:01
> 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
- Raw text -