Misleading error message with mv and existing directories

Bug #71174 reported by Stephen Shirley on 2006-11-10
Affects Status Importance Assigned to Milestone
coreutils (Ubuntu)

Bug Description

Binary package hint: coreutils

Steps to reproduce:
mkdir -p a b/a
touch b/a/foo
mv a b

Expected result:
mv: cannot overwrite directory `b/a'

Actual result:
mv: cannot move `a' to a subdirectory of itself, `b/a'

This is on edgy, kernel 2.6.17-10-generic, coreutils 5.96-5-ubuntu4

Micah Cowan (micahcowan) on 2007-04-07
Changed in coreutils:
status: Unconfirmed → Confirmed
Micah Cowan (micahcowan) on 2007-05-16
Changed in coreutils:
importance: Undecided → Low
Paul Boddie (paul-boddie) wrote :

Still an issue on Feisty, kernel 2.6.20-16-generic, coreutils 5.97-5.2ubuntu3

kenn9704 (koym) wrote :

  Wow, thanks for this posting; but, your know how is beyond me; so, I just sent <email address hidden> this message.
Attn: <email address hidden>

   Repeatedly, OO 2.2 has froze while saving a document; often this happens just as I open and select a line or two for placing in another document or place it in an email for sending. Then, I have to spend hours and hours to resolve the glitch. Last night I said, "before going to bed, this is the latest response in the terminal
mv: cannot move `/root/.openoffice.org2' to a subdirectory of itself, `/root/.openoffice.org2_backup/.openoffice.org2'
what causes this?"

Yes, why does OO 2.2 easily freeze while saving? Once it happens, one can click Launch Run Command [terminal] & enter mv ~/.openoffice.org2 ~/.openoffice.org2_backup but even that cure begins to fail. So, what is the next step that one may take to get freed of this hinderance? The following insights sent me by DrHu on the Freespire forum, is beyond my brain power. Read from DrHu who says http://forum.freespire.org/showthread.php?p=105526#post105526 as follows: https://bugs.launchpad.net/ubuntu/+s...ils/+bug/71174
mv --help
mv --help
Usage: mv [OPTION]... [-T] SOURCE DEST
Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.

Mandatory arguments to long options are mandatory for short options too.
--backup[=CONTROL] make a backup of each existing destination file
-b like --backup but does not accept an argument
-f, --force do not prompt before overwriting
-i, --interactive prompt before overwrite
--strip-trailing-slashes remove any trailing slashes from each SOURCE
-S, --suffix=SUFFIX override the usual backup suffix
-t, --target-directory=DIRECTORY move all SOURCE arguments into DIRECTORY
-T, --no-target-directory treat DEST as a normal file
-u, --update move only when the SOURCE file is newer
than the destination file or when the
destination file is missing
-v, --verbose explain what is being done
--help display this help and exit
--version output version information and exit

The backup suffix is `~', unless set with --suffix or SIMPLE_BACKUP_SUFFIX.
The version control method may be selected via the --backup option or through
the VERSION_CONTROL environment variable. Here are the values:

none, off never make backups (even if --backup is given)
numbered, t make numbered backups
existing, nil numbered if numbered backups exist, simple otherwise
simple, never always make simple backups

Report bugs to <email address hidden>.

I believe this is an OO 2.2 bug that needs a general solution. Write me back if I can provide further clarification. The question surely is beyond my knowledge.

Please help us.

Kenneth Koym

Paul Boddie (paul-boddie) wrote :

Still an issue on Gutsy, kernel 2.6.22-16-generic, coreutils 5.97-5.3ubuntu3

It is, however, fixed in gutsy (coreutils 6.10-3ubuntu2):

$ mkdir -p a b/a
$ touch b/a/foo
$ mv a b
mv: cannot move `a' to `b/a': Directory not empty

Philipp Kohlbecher (xt28) wrote :

And when I say "gutsy", I mean "hardy".
Sorry about that...

ken78724 (koymkg) wrote :

I solved the problem temporarily by setting my PC aside and began using a new 80 gig Mirus PC with Ubuntu Hardy 8.04.1. Found OO 2.4 did not freeze up. Sorry I went on and let Feisty go... Someone else is using that PC now.

kenneth koym

C de-Avillez (hggdh2) wrote :

Marking as fix released: works as expected on Hardy, Intrepid, Jaunty, and Karmic.

Changed in coreutils (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers