Next: renameat
, Previous: remquol
, Up: ISO C and POSIX Function Substitutes [Contents][Index]
rename
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/rename.html
Gnulib module: rename
Portability problems fixed by Gnulib:
rename("dir","new/")
:
NetBSD 1.6.
rename("file","new/")
:
AIX 7.1, Solaris 11.3, Cygwin 1.5.x, mingw, MSVC 14.
rename("link-to-file/","f")
:
FreeBSD 7.2.
rename("link/","new")
corrupts link:
Solaris 9.
Portability problems not fixed by Gnulib:
rename("symlink-to-dir/","dir2")
rename
dir and leave symlink-to-dir dangling; likewise, it
requires that rename("dir","dangling/")
rename dir so
that dangling is no longer a dangling symlink. This behavior
is counter-intuitive, so on some systems, rename
fails with
ENOTDIR
if either argument is a symlink with a trailing slash:
glibc, OpenBSD, Cygwin 1.7.
rename
do nothing and return 0 if the
source and destination are hard links to the same file. This behavior
is counterintuitive, and on some systems renameat
is a no-op in
this way only if the source and destination identify the same
directory entry. On these systems, for example, although renaming
./f to f is a no-op, renaming f to g
deletes f when f and g are hard links to the same
file:
NetBSD 7.0.
stat
function
for 30 seconds after the rename, on NFS file systems, on some platforms:
Linux 2.6.18.
Next: renameat
, Previous: remquol
, Up: ISO C and POSIX Function Substitutes [Contents][Index]