dirstat-rs icon indicating copy to clipboard operation
dirstat-rs copied to clipboard

Filesystem Boundaries

Open dsully opened this issue 4 years ago • 3 comments

Other tools (such as dust) work across filesystem boundaries. Is there a reason dirstat-rs specifically does not?

I see in lib.rs:

if volume_id != root_dev {
    return Err("Filesystem boundary crossed".into());
}

Commenting out those lines makes ds work as I would expect.

Thanks

dsully avatar Mar 24 '20 15:03 dsully

Lunux's du also don't cross boundaries. IDK what is the reasoning.

One of possible reasons -- to not fail to endless recursion from symlinks. Perhaps other reasons exist as well.

Mart-Bogdan avatar Oct 27 '21 23:10 Mart-Bogdan

P.S. when I used du last time it crossed boundaries, but I definitely noticed code related to fs detection side du sources. But I am not 100% sure how du works, and lack experience with Linux/unix.

Mart-Bogdan avatar Dec 13 '21 23:12 Mart-Bogdan

I tested on Linux. du -x won't cross boundaries.

So I suggest dirstat-rs should also have -x option, and skip other file systems only with that option.

If we want to be as consistent with du. If we want to preserve backward compatibility with dirstat-rs -- could go in opposite direction and us -X to allow passing boundaries.

I would prefer to make it compatible with du.

Mart-Bogdan avatar Nov 03 '22 23:11 Mart-Bogdan