[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: mv: Moving directories to "themselves" (not the bug with incorrect e
From: |
Eric Blake |
Subject: |
Re: mv: Moving directories to "themselves" (not the bug with incorrect error message) |
Date: |
Sun, 18 Nov 2007 06:20:58 -0700 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Michal Wencl on 11/18/2007 3:16 AM:
> mkdir -p a b/a
> touch a/1 a/2 b/a/2
> move a b
>
> Current result:
>
> In my version of mv (5.97) the following error message is returned:
Consider upgrading. The latest stable version of coreutils is 6.9, and it
includes some bug fixes for mv.
> Expected result:
>
> Directory a is fully moved to directory b/a, thus b/a contains files
> 1 and 2 where b/a/2 was overwritten witch a/2.
Wrong. POSIX doesn't allow this behavior. In order to move directory a
to a subdirctory of b, when b/a already exists, b/a must be unlinkable;
but since b/a is not empty, it can't be unlinked.
> Could you think about it, please? It would be great if at least a
> switch for it was added to mv (and other coreutils).
What you appear to be wanting is a new option to mv, maybe spelled like
'mv --merge'. But such a feature is not part of coreutils yet, because no
one has submitted a patch for it.
- --
Don't work too hard, make some time for fun as well!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFHQDw684KuGfSFAYARAvTiAJ4iBg1Ao0I16Y4vcxSIrtJJ4aeUUwCdGOd1
fUxP2Kr0h+vbSm0mRrjD8mQ=
=z0MJ
-----END PGP SIGNATURE-----