mirror of
https://github.com/bootandy/dust.git
synced 2026-06-08 11:29:05 +03:00
[GH-ISSUE #391] kib, mib, etc for -o should be powers of 1024, not 1000
#174
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @eatsu on GitHub (Apr 26, 2024).
Original GitHub issue: https://github.com/bootandy/dust/issues/391
According to Wikipedia, KiB, MiB, etc are units based on binary prefixes which are powers of 1024, but in Dust they seem to be treated as SI units which are powers of 1000.
https://github.com/bootandy/dust/blob/v1.0.0/src/display.rs#L412-L420
I'm afraid this is technically incorrect and is confusing.
For reference, commands
du,dfandlstreatK,M,KiB,MiB, etc as powers of 1024 andKB,MB, etc as powers of 1000. Quoting from their--help:I would appreciate it if this were fixed and
k,m, etc could be used as aliases forkib,mib, etc, like the above commands convention.Thanks!
@bootandy commented on GitHub (Apr 27, 2024):
Oh wow that's embarrassing. I've implemented it backwards, haven't I. Good find. How did you notice that ?
I think this is a recent bug only in this version, it's from when I merged the behaviour of the now redundant
--siflag.@bootandy commented on GitHub (Apr 27, 2024):
https://github.com/bootandy/dust/pull/392
does this look right ?
@eatsu commented on GitHub (Apr 28, 2024):
I noticed that the values of the output K was different between with
-o kiband without the flag when working on_dust_output_formatsin #390 :)kib/mib/kb/mbwork now as I expected as far as I've tested. Thank you! However, it seems thatk/mare now powers of 1000, which is different from the behavior ofdu/df/ls.@bootandy commented on GitHub (Apr 28, 2024):
Noted, updated.
@eatsu commented on GitHub (Apr 29, 2024):
Ah, it now works perfectly for me. Thank you again!
@bootandy commented on GitHub (May 1, 2024):
will go out in next release