avoid some overlong lines from posix urls, etc.
[gnulib.git] / doc / posix-functions / unlink.texi
1 @node unlink
2 @section @code{unlink}
3 @findex unlink
4
5 POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/unlink.html}
6
7 Gnulib module: unlink
8
9 Portability problems fixed by Gnulib:
10 @itemize
11 @item
12 Some systems mistakenly succeed on @code{unlink("link-to-file/")}:
13 GNU/Hurd, FreeBSD 7.2, AIX 7.1, Solaris 9.
14 @item
15 On MacOS X 10.5.6, in a writable HFS mount, @code{unlink("..")} succeeds
16 without doing anything.
17 @end itemize
18
19 Portability problems not fixed by Gnulib:
20 @itemize
21 @item
22 Some systems allow a superuser to unlink directories, even though this
23 can cause file system corruption.  The error given if a process is not
24 permitted to unlink directories varies across implementations; it is
25 not always the POSIX value of @code{EPERM}.  Meanwhile, if a process
26 has the ability to unlink directories, POSIX requires that
27 @code{unlink("symlink-to-dir/")} remove @file{dir} and leave
28 @file{symlink-to-dir} dangling; this behavior is counter-intuitive.
29 The gnulib module unlinkdir can help determine whether code must be
30 cautious of unlinking directories.
31 @item
32 Removing an open file is non-portable: On Unix this allows the programs that
33 have the file already open to continue working with it; the file's storage
34 is only freed when the no process has the file open any more.  On Windows,
35 the attempt to remove an open file fails.
36 @end itemize