Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

df: correctly scale bytes by block size #3182

Merged
merged 1 commit into from
Feb 23, 2022

Conversation

jfinkels
Copy link
Collaborator

Change df so that it correctly scales numbers of bytes by the
default block size, 1024, when neither -h nor -H are specified on the
command-line. Previously, it was not scaling the number of bytes in
this case.

Now GNU df produces:

$ df | sort | head -n1
/dev/loop0                    56832    56832         0 100% /snap/core18/2253

and uutils df produces:

$ ./target/debug/df | sort | head -n1
/dev/loop0              56832        56832            0  100% /snap/core18/2253

(The spacing is wrong, but the numbers are right. This pull request is not about the spacing.)

Fixes #3058.

Change `df` so that it correctly scales numbers of bytes by the
default block size, 1024, when neither -h nor -H are specified on the
command-line. Previously, it was not scaling the number of bytes in
this case.

Fixes uutils#3058.
@sylvestre sylvestre merged commit 6224a08 into uutils:main Feb 23, 2022
@tertsdiepraam
Copy link
Member

@jfinkels There were some doc warnings in the CI, could you fix those in another PR?

@jfinkels
Copy link
Collaborator Author

jfinkels commented Feb 24, 2022 via email

@jfinkels jfinkels deleted the df-scale-by-block-size branch February 24, 2022 02:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

df: displayed sizes are in the wrong units
3 participants