X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=doc%2Fposix-functions%2Frename.texi;h=5ed822a14364780d8338cd1a0e5ffaa02e7c37d1;hb=fa1db0dd22768f09a507674a30beb5b8a87bb35f;hp=62b1fc8d6ac1535d5c684e15e4e2cb3190dd8e97;hpb=09ef7461110822a3970aa8eebcfaa740996a82f2;p=gnulib.git diff --git a/doc/posix-functions/rename.texi b/doc/posix-functions/rename.texi index 62b1fc8d6..5ed822a14 100644 --- a/doc/posix-functions/rename.texi +++ b/doc/posix-functions/rename.texi @@ -2,18 +2,70 @@ @section @code{rename} @findex rename -POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/rename.html} +POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/rename.html} Gnulib module: rename Portability problems fixed by Gnulib: @itemize @item -This function does not work when the source file name ends in a slash on -some platforms: +This function does not allow trailing slashes when creating a +destination directory, as in @code{rename("dir","new/")}: +NetBSD 1.6. +@item +This function does not reject trailing slashes on the destination for +non-directories on some platforms, as in @code{rename("file","new/")}: +AIX 7.1, Solaris 11 2011-11, Cygwin 1.5.x, mingw, MSVC 9. +@item +This function does not reject trailing slashes on symlinks to +non-directories on some platforms, as in +@code{rename("link-to-file/","f")}: +FreeBSD 7.2. +@item +This function ignores trailing slashes on symlinks on some platforms, +such that @code{rename("link/","new")} corrupts @file{link}: +Solaris 9. +@item +This function incorrectly reduces the link count when comparing two +spellings of a hard link on some platforms: +NetBSD 1.6, Cygwin 1.5.x. +@item +This function will not always replace an existing destination on some +platforms: +Cygwin 1.5.x, mingw, MSVC 9. +However, the replacement is not atomic for directories, and may end up +losing the empty destination if the source could not be renamed. +@item +This function mistakenly allows names ending in @samp{.} or @samp{..} +on some platforms: +Cygwin 1.5.x, mingw, MSVC 9. +@item +This function does not reject attempts to rename existing directories +and non-directories onto one another on some platforms: +Cygwin 1.5.x, mingw, MSVC 9. +@item +This function does not allow trailing slashes on source directories on +older platforms, as in @samp{rename("dir/","new")}: SunOS 4.1. @end itemize Portability problems not fixed by Gnulib: @itemize +@item +POSIX requires that @code{rename("symlink-to-dir/","dir2")} rename +@file{dir} and leave @file{symlink-to-dir} dangling; likewise, it +requires that @code{rename("dir","dangling/")} rename @file{dir} so +that @file{dangling} is no longer a dangling symlink. This behavior +is counter-intuitive, so on some systems, @code{rename} fails with +@code{ENOTDIR} if either argument is a symlink with a trailing slash: +glibc, OpenBSD, Cygwin 1.7. +@item +After renaming a non-empty directory over an existing empty directory, +the old directory name is still visible through the @code{stat} function +for 30 seconds after the rename, on NFS file systems, on some platforms: +Linux 2.6.18. +@item +This function will not rename a source that is currently opened +by any process: +mingw, MSVC 9. @end itemize