Git Product home page Git Product logo

treesize-rs's People

Contributors

melak47 avatar nabijaczleweli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

treesize-rs's Issues

Option to stay within one filesystem

For example: tar -c / --one-file-system doesn't traverse into /dev, &c.

It'd be nice to be able to do that in treesize, as well, instead of manually filtering these afterward.

This is more of a question of "would you accept a PR that did this" as opposed to "please implement".

Panic on non-unicode text output?

Try running treesize from a directory containing a .git directory:

thread '

' panicked at 'failed printing to stdout: text was not valid unicode', ../src/libstd\io\stdio.rs:626

Options to limit output size

Using treesize on deeply nested hierarchies or whole disks produces huge, deeply nested output, which is not useful for getting a quick overview.

There should be options to control how the output is displayed.
I can think of a few possibilities:

  • limit nesting depth: only expand directories N levels deep - implemented by @nabijaczleweli
  • limit entries per directory: show only the M biggest entries

N and M should have some sane defaults, possibly derived from the terminal size.

Don't panic

treesize shouldn't panic if some file or directory cannot be accessed (for any number of reasons - file no longer exists, permission denied...).
Maybe output warnings mentioning the path to stderr, record the size as 0, and move on?

Symlinks are completely ignored

Observe:

t:\nabijaczleweli.xyz>ls -la
total 46
drwxr-xr-x 1 nabijaczleweli None     0 Feb 28 15:23 .
drwxr-xr-x 1 nabijaczleweli None     0 Mar  1 02:03 ..
-rw-r--r-- 1 nabijaczleweli None    19 Oct 10 01:46 CNAME
-rw-r--r-- 1 nabijaczleweli None  1082 Jun  4  2016 LICENSE-CODE
-rw-r--r-- 1 nabijaczleweli None 20131 Jun  4  2016 LICENSE-CREATIVE
-rw-r--r-- 1 nabijaczleweli None    70 Jun  4  2016 README.md
lrwxrwxrwx 1 nabijaczleweli None    39 Feb 28 15:22 assets -> /p/HTML/nabijaczleweli.github.io/assets
lrwxrwxrwx 1 nabijaczleweli None    40 Feb 24 22:05 capitalism -> /p/HTML/nabijaczleweli.github.io-dev/out
lrwxrwxrwx 1 nabijaczleweli None    36 Feb 28 15:22 css -> /p/HTML/nabijaczleweli.github.io/css
-rw-r--r-- 1 nabijaczleweli None  2297 Feb 28 15:33 index.html
lrwxrwxrwx 1 nabijaczleweli None    35 Feb 28 15:23 js -> /p/HTML/nabijaczleweli.github.io/js
-rw-r--r-- 1 nabijaczleweli None  2943 Nov 15  2015 keybase.txt

t:\nabijaczleweli.xyz>treesize -a
.                     25.9  KB  (Σ)
├── LICENSE-CREATIVE  19.7  KB
├── keybase.txt       2.9   KB
├── index.html        2.2   KB
├── LICENSE-CODE      1.1   KB
├── README.md         70    B
└── CNAME             19    B

Incorrect human readable metric prefixes

KB MB GB and other prefixes are stand for 10 power 2, 10 power 3 and so on. It's base 10 prefixes, but your code actually counts base 2 values, so human readable prefixes should be KiB, MiB and so on to display actual values.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.