diff options
author | Jim Meyering <meyering@redhat.com> | 2008-01-26 12:29:41 +0100 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2008-01-26 17:16:38 +0100 |
commit | c0c8685d46d106d5bf5eaed47b970db4ded672b3 (patch) | |
tree | 76483b2e383450365e027d3803f003298503a81b | |
parent | 2c6754363fa8e42a69f024c105f0a28d4145ab9c (diff) | |
download | coreutils-c0c8685d46d106d5bf5eaed47b970db4ded672b3.tar.gz coreutils-c0c8685d46d106d5bf5eaed47b970db4ded672b3.tar.bz2 coreutils-c0c8685d46d106d5bf5eaed47b970db4ded672b3.zip |
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.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | doc/coreutils.texi | 12 |
2 files changed, 16 insertions, 4 deletions
@@ -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. diff --git a/doc/coreutils.texi b/doc/coreutils.texi index 3785eae9f..0de856089 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -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}. |