]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Improve a warning about non-portable "mv" usage.
authorJim Meyering <meyering@redhat.com>
Sat, 26 Jan 2008 11:29:41 +0000 (12:29 +0100)
committerJim Meyering <meyering@redhat.com>
Sat, 26 Jan 2008 16:16:38 +0000 (17:16 +0100)
* doc/coreutils.texi (mv invocation): Adjust the warning: moving a
dir-symlink-specified-with-a-trailing-slash works in a surprising
manner only on some systems.  Reported by Tomas Pospisek in
http://bugs.debian.org/343652.

ChangeLog
doc/coreutils.texi

index 427c8ebb697867a2edb419c2ce8d791c69b1cd43..24c621d22db3e2d20f359f7658f3057af8d2ca8c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-01-26  Jim Meyering  <meyering@redhat.com>
+
+       Improve a warning about non-portable "mv" usage.
+       * doc/coreutils.texi (mv invocation): Adjust the warning: moving a
+       dir-symlink-specified-with-a-trailing-slash works in a surprising
+       manner only on some systems.  Reported by Tomas Pospisek in
+       http://bugs.debian.org/343652.
+
 2008-01-26  Mike Frysinger  <vapier@gentoo.org>
 
        * src/dircolors.hin (TERM): Add jfbterm.
index 3785eae9f5ec7620de35a5a21587771f6b886964..0de856089b2c7062a210e8dae26c95e39029123e 100644 (file)
@@ -7773,10 +7773,14 @@ is a terminal, and the @option{-f} or @option{--force} option is not given,
 own the file, or have write permission on its directory.)  If the
 response is not affirmative, the file is skipped.
 
-@emph{Warning}: If you try to move a symlink that points to a directory,
-and you specify the symlink with a trailing slash, then @command{mv}
-doesn't move the symlink but instead moves the directory referenced
-by the symlink.  @xref{Trailing slashes}.
+@emph{Warning}: Avoid specifying a source name with a trailing slash,
+when it might be a symlink to a directory.
+Otherwise, @command{mv} may do something very surprising, since
+its behavior depends on the underlying rename system call.
+On modern Linux systems, it fails with @code{errno=ENOTDIR}.
+However, on other systems (at least FreeBSD 6.1 and Solaris 10) it silently
+renames not the symlink but rather the directory referenced by the symlink.
+@xref{Trailing slashes}.
 
 The program accepts the following options.  Also see @ref{Common options}.