bug-coreutils@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Nir Oren <niro@edev.co>
To: 64785@debbugs.gnu.org
Subject: bug#64785: Package: coreutils Version: 8.32-4+b1 program=mv
Date: Fri, 21 Jul 2023 20:17:00 +0300	[thread overview]
Message-ID: <CAHKKKjYdY6DU6MRCWhxVd-JrLTODn-96YVqwi=pMacWfDUQ1xQ@mail.gmail.com> (raw)

*mv: error message "Directory not empty" is confusing *

description: when you try to move a directory to a location already
containing a directory with the same name it would just write "mv: cannot
move 'A' to 'B': Directory not empty"

first, this is technically a wrong error message because there is no
requirement that the destination would be empty.
the destination might as well be populated with some content, we just
require that it would not contain a directory with the same name.

second, the error message is confusing because it doesn't state that the
problem is with the destination. One can think that the problem is actually
with the source, and that the source directory has some kind of attribute
that would require it to be empty prior to moving.

I would suggest to change the error message to: "*a directory with the same
name already exists at destination*"

reproduction:
$:rm -rf /tmp/node_modules
$:mkdir -p proj1/node_modules
$:touch proj1/node_modules/foo
$:mkdir -p proj2/node_modules
$:touch proj2/node_modules/bar
$:mv proj1/node_modules /tmp
$:mv proj2/node_modules /tmp
mv: cannot move 'proj2/node_modules' to '/tmp/node_modules': Directory not
empty

             reply	other threads:[~2023-07-22  7:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-21 17:17 Nir Oren [this message]
2023-07-22 10:19 ` bug#64785: Package: coreutils Version: 8.32-4+b1 program=mv Pádraig Brady
2023-07-22 17:37   ` Paul Eggert
2023-07-22 18:25     ` Pádraig Brady
2023-07-22 19:41     ` Nir Oren
2023-07-22 20:47       ` Paul Eggert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-coreutils

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHKKKjYdY6DU6MRCWhxVd-JrLTODn-96YVqwi=pMacWfDUQ1xQ@mail.gmail.com' \
    --to=niro@edev.co \
    --cc=64785@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).