mirror of
https://github.com/bootandy/dust.git
synced 2026-06-08 11:29:05 +03:00
[GH-ISSUE #234] Visiting directory with hard linked files produces unstable result #106
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 @gwy15 on GitHub (Aug 14, 2022).
Original GitHub issue: https://github.com/bootandy/dust/issues/234
The issue
Let's say I have this directory with the following structure
where
sample.txt,sample2.txtandsample3.txthave the same inode (hard linked).Running
dustproduces unstable results,Expected behavior
From my personal perspective, I would want the result to be stable, i.e., always list the size under directory
sample.If possible, I would prefer that I can specify the order to visit directories from command line arguments.
I understand that the code visit directories in a parallel way, will this be a problem to produce a stable result?
@bootandy commented on GitHub (Aug 15, 2022):
I can't guarantee stable results. Because we have several threads running, which ever 'finds' it first will include it.
I would rather have it be stable too but I'm not sure the best way to do this.
( We could revive
dust --num-threads=1and force it to run with a single thread. That way results should be stable. )dust -swill show apparent size and will create an output similar to tree if that helps, this should be stable.@gwy15 commented on GitHub (Aug 18, 2022):
how about visit files concurrently and save the inodes first, then later decide which directory the inodes belong to? This should not compromise speed but should produce a stable result.