view doc/posix-functions/rename.texi @ 13776:2285cf35fa15

docs: update cygwin progress * doc/glibc-functions/mkostemp.texi (mkostemp): Added in cygwin 1.7.6. * doc/glibc-functions/mkostemps.texi (mkostemps): Likewise. * doc/posix-headers/fenv.texi (fenv.h): Added after cygwin 1.7.7. * doc/posix-functions/feclearexcept.texi (feclearexcept): Likewise. * doc/posix-functions/fegetenv.texi (fegetenv): Likewise. * doc/posix-functions/fegetexceptflag.texi (fegetexceptflag): Likewise. * doc/posix-functions/fegetround.texi (fegetround): Likewise. * doc/posix-functions/feholdexcept.texi (feholdexcept): Likewise. * doc/posix-functions/feraiseexcept.texi (feraiseexcept): Likewise. * doc/posix-functions/fesetenv.texi (fesetenv): Likewise. * doc/posix-functions/fesetexceptflag.texi (fesetexceptflag): Likewise. * doc/posix-functions/fesetround.texi (fesetround): Likewise. * doc/posix-functions/fetestexcept.texi (fetestexcept): Likewise. * doc/posix-functions/feupdateenv.texi (feupdateenv): Likewise. * doc/glibc-functions/feenableexcept.texi (feenableexcept): Likewise. * doc/glibc-functions/fedisableexcept.texi (fedisableexcept): Likewise. * doc/glibc-functions/fegetexcept.texi (fegetexcept): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com>
author Eric Blake <eblake@redhat.com>
date Thu, 07 Oct 2010 08:42:24 -0600
parents bb0ceefd22dc
children 99f7d71ff81f
line wrap: on
line source

@node rename
@section @code{rename}
@findex rename

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 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 10, Cygwin 1.5.x, mingw.
@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.
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.
@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.
@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
This function will not rename a source that is currently opened
by any process:
mingw.
@end itemize