Dear Gnu fileutils Maintainers:

This problem exists in version 4.0 running with RedHat Linux 6.1 or 
Solaris 2.7 but not with version 3.12 running on Slackware 3.0.

If I try to mv a directory inside itself sometimes mv actually tries
to do this.  Two examples suffice:

$ mkdir oops
$ cd oops
$ mkdir a b
$ touch a/f1 b/f2
$ mv a b b
mv: b/b/a: won't create hard link `b/b' to directory `(null)'
$ find .
.
./b
./b/f2
./b/a
./b/a/f1
./b/b
./b/b/f2

So there are now two copies of f2 and the directory b is duplicated
inside of b.  If I change the order of the files in the move command 
in the above example the correct behavior results.

$ mv b a b
mv: cannot move `b' to a subdirectory of itself, `b/b'
$ find .
.
./b
./b/f2
./b/a
./b/a/f1

The above examples are with a locally mounted drive.  Worse things 
can happen to NFS mounted devices but that is expected.

Thanks, Eric Olson

Reply via email to