mirror of
https://github.com/bootandy/dust.git
synced 2026-06-08 11:29:05 +03:00
[GH-ISSUE #264] Add flag to ignore hard links #114
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @EmNudge on GitHub (Sep 9, 2022).
Original GitHub issue: https://github.com/bootandy/dust/issues/264
Attempting to calculate the size of a directory after using tools which take advantage of hard links to reduce duplication across directories. It's not enough to only count hard links a single time in a run since those hard links all originate elsewhere and the originals won't be caught by
dustordu.Not even
duhas this feature afaik, so it would be a nice bonus to have fromdust.Alternatively, we can follow the behavior of
duin that listing multiple directories allows us to use hard links from previous dirs in ignoring later dirs. When trying to filter out packages frompnpmon macos, for example, we can rundust -sh ./Library/pnpm ./our-folderand we should be removing all the hardlinks from./our-folderthat have been counted already from./Library/pnpm.@bootandy commented on GitHub (Sep 11, 2022):
So an option that ignores hard-links? I imagine it should ignore soft-links as well?
Do you think the links should be completely ignored or should they be listed but just as near-empty files ?
@EmNudge commented on GitHub (Sep 11, 2022):
Yeah, an option to ignore all symbolic links would be nice. You can keep them, but list the size of the symbolic link instead of the content it points to, so it would show as a very small file. I guess the option would more accurately be named "don't follow symlinks" rather than ignore them.
@bootandy commented on GitHub (Oct 20, 2022):
I don't think this is possible.
https://unix.stackexchange.com/questions/122333/how-to-tell-which-file-is-original-if-hard-link-is-created
It is not possible to know which is a hard-link and which is the original
@EmNudge commented on GitHub (Nov 22, 2022):
That's unfortunate. Perhaps then just a flag to ignore duplicate files? It would accidentally capture legitimate duplicates, but it would still solve a bit of the problem.
@bootandy commented on GitHub (Jan 5, 2023):
it already ignores duplicate files. If 2 files have the same inode it will only count them once.