[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mv trailing slash warning

From: Jim Meyering
Subject: Re: mv trailing slash warning
Date: Sun, 25 Sep 2005 22:37:52 +0200

"Dr. David Alan Gilbert" <address@hidden> wrote:
>   In the info pages for 'mv' is the following statement:
> ---------------------------------------------------------------------------
>   _Warning_: If you try to move a symlink that points to a directory,
> and you specify the symlink with a trailing slash, then `mv' doesn't
> move the symlink but instead moves the directory referenced by the
> symlink.  *Note Trailing slashes::.
> ---------------------------------------------------------------------------
> $ mkdir a b
> $ ln -s $PWD/a sym
> $ mv sym/ b
> mv: cannot move `sym/' to `b/sym': Not a directory
> The 'mv' is straight out of recent cvs. I'm in an ext3 filesystem
> on Linux (Ubuntu).
> Am I misunderstanding something about that warning or is this
> a bug?

It depends on the semantics of the rename syscall.
And those semantics vary from system to system.
On older linux systems (probably 2.4.x, certainly 2.2.20, which
I've just tested) your mv command renames `a' to b/sym.

Losing systems probably deserve a configure-time test and a rename
wrapper to correct for the unexpected behavior.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]