The tin summer - a replacement for 'du'

I wrote a replacement for 'du' that fixes a lot of the problems that I had with it (odd defaults, no colored terminal output). It also has a naive parallel directory traversal that makes it slightly faster in most cases.

Comments & bug reports welcome.

https://github.com/vmchale/tin-summer

7 Likes

I've been using it for quite a while, and it is really great so far, much more convenient then du! The only problem for me is that I always forget the name of the command :frowning:

Glad to hear! If it helps at all, sn comes from the atomic symbol for tin.

Although that being said the name isn't the clearest either. I partly picked sn because it was easier to type than sniff, if that helps at all :slight_smile:

1 Like

Yay! More pure rust core-utils! :heart:

How naive are we talking here?
If it helps, BurntSushi has released the parallel dirwalker he used for RipGrep, maybe that can provide inspiration, or opportunities for code reuse/crate dependencies :slight_smile:

1 Like

I've seen it! Unfortunately, the crate has a couple pain points, and even if those were resolved, I would still have to pass around some sort of keyed map using a mutex or the like (hence my current "naive" implementation). I could probably work out something a little better using rayon, but it would be a bit of work.

1 Like

Please file bugs. I would be happy to try to help you work around them. If you can, you'll be able to avoid reproducing a ton of work. Even if you can't use the dir walker (which is perhaps a bit too constrained to ripgrep's use case), you can hopefully reuse the Gitignore matcher or even the glob set matcher. Getting that stuff to match gitignore semantics and stay fast was quite difficult!

There is also the termcolor crate, which will give you working colors in Windows.

4 Likes