dust icon indicating copy to clipboard operation
dust copied to clipboard

Is it possible to set the unit of measurement to a specified value,like KB?

Open TYzzt opened this issue 2 years ago • 4 comments

When the size of storage is large, the accuracy loses the angle

TYzzt avatar Apr 03 '23 07:04 TYzzt

https://github.com/bootandy/dust/pull/322

TYzzt avatar Apr 10 '23 07:04 TYzzt

I'm not particularly keen on adding this flag. What is the usecase for it?

If you need to know the exact size of a file you can use du for that.

dust is going to ignore several files anyway with its targetted summary so I'm not sure what value this adds.

bootandy avatar May 05 '23 19:05 bootandy

Fast and relatively accurate estimation of storage usage in HPC distributed storage scenarios

TYzzt avatar May 06 '23 10:05 TYzzt

Hmm, maybe, let me sleep on it.

bootandy avatar May 07 '23 09:05 bootandy

How do I get the size in bytes? When I share files, I prefer to specify the size in bytes so that people don't get confused (KB, KiB, etc). In addition, one can later process the output in bytes by other programs, such as awk, and convert it to the desired units.

sergeevabc avatar Feb 18 '24 19:02 sergeevabc

Please add a --format option, to specify the output's size format.

I want to parse the output from another script (in Python in my case) to merge it with other reports. I prefer to call dust in a subprocess, and parse its output, because it's much faster than a native-Python solution. But I don't want to turn my Python script which merges reports to Rust, because it would be too much work and it's already fast enough.

Any chance to implement that?

dua offers this option:

  -f, --format <FORMAT>
          The format with which to print byte counts

          [default: binary]
          [possible values: metric, binary, bytes, gb, gib, mb, mib]

cgkantidis avatar Feb 19 '24 13:02 cgkantidis

Ok, clearly people want this. I'll look into it.

bootandy avatar Feb 19 '24 20:02 bootandy

We could merge the --format flag with the --iso flag. - they seem to do similar things.

bootandy avatar Feb 21 '24 22:02 bootandy

I also need this feature. currently i'm forced to use du which is extremely slow and slows down an important script. i wanted to replace it with dust but it forces the -h (human readable). a --format or the inverse of a -h even if it's not precise would be great! thank !

nda-cunh avatar Mar 14 '24 00:03 nda-cunh

https://github.com/bootandy/dust/pull/373

it's merged it'll be in the next release.

bootandy avatar Mar 14 '24 21:03 bootandy

@bootandy, every time I run dust.exe on Windows 7 x64 the first thing that appears on the screen is the following line: “This version of Windows does not support ANSI colors”. Not sure why it happens, since, for example, ripgrep and bat render colors fine. Anyway, I don't want to feel second-rate here.

sergeevabc avatar Apr 16 '24 02:04 sergeevabc

I don't have a windows box. - Does dust go on to print with colors or not ?

Does this happen with all versions ?

bootandy avatar Apr 17 '24 07:04 bootandy

$ dust.v.0.5.0.exe C:\TEMP
thread 'main' panicked at 'Couldn't enable color support: 87', src\libcore\result.rs:1188:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

$ dust.v.1.0.0.exe C:\TEMP
This version of Windows does not support ANSI colors
1.2M     ┌── 25ac4429-4010-4cb0-ae65-ff1163082860.tmp                │█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │   1%

1.7M     ├── c3846ae4-d804-49ac-9640-961b052d976a.tmp                │█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │   2%

2.3M     ├── 8970d8850fb3c3cfc8eb4b517bc2fd39f84670c1.megatools.cache│██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │   2
...

sergeevabc avatar May 13 '24 13:05 sergeevabc