coreutils
coreutils copied to clipboard
du: ignore duplicate paths provided by user
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.
GNU testsuite comparison:
Congrats! The gnu test tests/tail/retry is no longer failing!
Good catch, thanks!
Yes, I agree, it makes sense to get the whole thing done.
@cakebaker are you planning to finish it? thanks
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