melak47 / treesize-rs Goto Github PK
View Code? Open in Web Editor NEWList directory tree, sorted by size
License: MIT License
List directory tree, sorted by size
License: MIT License
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".
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
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:
N
levels deepM
biggest entriesN
and M
should have some sane defaults, possibly derived from the terminal size.
1.9 stable landed: http://blog.rust-lang.org/2016/05/26/Rust-1.9.html
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?
or ignore dotfiles by default and unignore via flag
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
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.