coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

du: ignore duplicate paths provided by user

Open cakebaker opened this issue 2 years ago • 4 comments

This PR ignores duplicate paths provided by the user and so du a a a has the same output as du a. However, if the path doesn't exist, multiple error messages are shown. This matches the behavior of GNU du.

cakebaker avatar Nov 06 '23 13:11 cakebaker

GNU testsuite comparison:

Congrats! The gnu test tests/tail/retry is no longer failing!

github-actions[bot] avatar Nov 06 '23 15:11 github-actions[bot]

Good catch, thanks!

Yes, I agree, it makes sense to get the whole thing done.

cakebaker avatar Nov 07 '23 16:11 cakebaker

@cakebaker are you planning to finish it? thanks

sylvestre avatar Apr 21 '24 07:04 sylvestre

Note that all of this could be just thought of as weird hardlinks, because hardlinks have to be detected anyway:

$ ln README.md README.md.hd
$ ../gnu/src/du -bc README.md README.md.hd # It's a hardlink, don't count it twice
7973	README.md
7973	total
$ cargo run du -bc README.md README.md.hd # Whoops!
7973	README.md
7973	README.md.hd
15946	total

BenWiederhake avatar Apr 24 '24 01:04 BenWiederhake