emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#64785: closed (Package: coreutils Version: 8.32-4+b1 program=mv)


From: GNU bug Tracking System
Subject: bug#64785: closed (Package: coreutils Version: 8.32-4+b1 program=mv)
Date: Sat, 22 Jul 2023 20:48:02 +0000

Your message dated Sat, 22 Jul 2023 13:47:47 -0700
with message-id <0b3fab88-372f-a3fa-64d1-8c85b58959c3@cs.ucla.edu>
and subject line Re: bug#64785: Package: coreutils Version: 8.32-4+b1 program=mv
has caused the debbugs.gnu.org bug report #64785,
regarding Package: coreutils Version: 8.32-4+b1 program=mv
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
64785: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=64785
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: Package: coreutils Version: 8.32-4+b1 program=mv Date: Fri, 21 Jul 2023 20:17:00 +0300
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

--- End Message ---
--- Begin Message --- Subject: Re: bug#64785: Package: coreutils Version: 8.32-4+b1 program=mv Date: Sat, 22 Jul 2023 13:47:47 -0700 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Thanks to both of you. I installed the attached into Savannah master coreutils. It implements the suggestion, except that later I noticed that EMLINK and ETXTBSY can join the throng.

At some point it might make sense to scan for other direct or indirect calls to renameat, renameat2, and linkat, where the diagnostic could be improved if it's known to refer to the destination.

Attachment: 0001-mv-better-diagnostic-for-mv-dir-x-failure.patch
Description: Text Data


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]