http://bugzilla.suse.com/show_bug.cgi?id=954549
http://bugzilla.suse.com/show_bug.cgi?id=954549#c3
Bernhard Voelker changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |INVALID
--- Comment #3 from Bernhard Voelker ---
Firt of all, you don't get the error "dir1 already exists in dir2",
but the error is this:
$ mv -v /dir/* /dir2/
mv: cannot move ‘/dir/dir1’ to ‘/dir2/dir1’: Directory not empty
When using strace, you'll see ...
rename("/dir/dir1", "/dir2/dir1") = -1 ENOTEMPTY (Directory not empty)
... that the mv(1) utility called the rename(2) system call,
and the kernel returned ENOTEMPTY.
Okay, going back to the POSIX specification already mentioned:
mv is supposed to work through the points starting with 1 down until
some condition says to stop processing.
In this case, mv(1) is stopping at 3):
The mv utility shall perform actions equivalent to the rename()
function
[...]
If this fails for any reasons other than those described for the
errno [EXDEV] [...], mv shall write a diagnostic message to standard
error, do nothing more with the current source_file, and go on to
any remaining source_files.
This means mv(1) is not supposed to "merge" the source into an existing
target directory on the same file system (the remaining steps 4..7 are
only for cases where the source and the target are on different file
systems).
Therefore, I'd say mv(1) is working as specified, thus closing this bug
as "INVALID".
--
You are receiving this mail because:
You are on the CC list for the bug.