coreutils
coreutils copied to clipboard
dd: correct rendering of SI and IEC byte counts
Adjust the rendering of the concise byte counts in both SI and IEC units to better match the behavior of GNU dd.
Before this commit,
$ head -c 1024 /dev/zero | dd > /dev/null
2+0 records in
2+0 records out
1024 bytes (1 KB, 1024 B) copied, 0.0 s, 1.0 MB/s
After this commit,
$ head -c 1024 /dev/zero | dd > /dev/null
2+0 records in
2+0 records out
1024 bytes (1.0 kB, 1.0 KiB) copied, 0.0 s, 1.0 MB/s
For comparison, GNU dd produces the following:
$ head -c 1024 /dev/zero | dd > /dev/null
2+0 records in
2+0 records out
1024 bytes (1.0 kB, 1.0 KiB) copied, 0.000332864 s, 3.1 MB/s
I am a bit sad that we cannot use a crate for this :)
ping?
I am a bit sad that we cannot use a crate for this :)
There seems to be some similar but slightly different code in df and numfmt as well, perhaps we can at least extract them into some common code in uucore at some point.
Could you please fix the job failures? thanks
Yes, I'll take a look this weekend. Sorry for the delay.
GNU testsuite comparison:
GNU test failed: tests/misc/tee. tests/misc/tee is passing on 'main'. Maybe you have to rebase?
GNU testsuite comparison:
GNU test failed: tests/tail-2/retry. tests/tail-2/retry is passing on 'main'. Maybe you have to rebase?
GNU testsuite comparison:
GNU test failed: tests/misc/timeout. tests/misc/timeout is passing on 'main'. Maybe you have to rebase?
I'm going to merge this because it keeps falling out of date with changes to Cargo.lock.