scullionw / dirstat-rs

(fastest?) disk usage cli, similar to windirstat.
MIT License
157 stars 11 forks source link

Filesystem Boundaries #1

Open dsully opened 4 years ago

dsully commented 4 years ago

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

Mart-Bogdan commented 2 years ago

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 commented 2 years ago

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 commented 1 year ago

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.