GNU bug report logs -
#64785
Package: coreutils Version: 8.32-4+b1 program=mv
Previous Next
Reported by: Nir Oren <niro <at> edev.co>
Date: Sat, 22 Jul 2023 07:55:02 UTC
Severity: normal
Done: Paul Eggert <eggert <at> cs.ucla.edu>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your bug report
#64785: Package: coreutils Version: 8.32-4+b1 program=mv
which was filed against the coreutils package, has been closed.
The explanation is attached below, along with your original report.
If you require more details, please reply to 64785 <at> debbugs.gnu.org.
--
64785: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=64785
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
[Message part 3 (text/plain, inline)]
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.
[0001-mv-better-diagnostic-for-mv-dir-x-failure.patch (text/x-patch, attachment)]
[Message part 5 (message/rfc822, inline)]
[Message part 6 (text/plain, inline)]
*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
[Message part 7 (text/html, inline)]
This bug report was last modified 1 year and 305 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.