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
Message #8 received at 64785 <at> debbugs.gnu.org (full text, mbox):
On 21/07/2023 18:17, Nir Oren wrote:
> *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.
Well that's not exactly the case.
mv will replace empty dirs in the destination,
so it is significant if the dir in the destination is empty or not.
> 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 think it's unlikely that users would be confused as
to whether the source needs to be empty.
> I would suggest to change the error message to: "*a directory with the same
> name already exists at destination*"
More accurately the error would be:
"a populated directory with the same name already exists"
Now would could argue that the above info is implicit in:
"directory not empty"
(which BTW is just the standard error from ENOTEMPTY).
Given the subtleties in this area,
I'd be reluctant to adjust diagnostics here.
thanks,
Pádraig
This bug report was last modified 1 year and 306 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.