uutils / uutils/coreutils

du: block size parsing

Open
#7,738 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

U - du
Dominant language
Rust
Stars
24.1k
Forks
2k
Avg merge
1d 5h
Merged PRs (30d)
365

Description

  • -B0 shouldn't panic. I think this should win some kind of "panic golf" :)
  • 1000 and kb and 1024 and k should result in different output, but parse_size_u64 causes information loss (i.e. does not return whether a multiplier was used).
  • 0b11 should be accepted (and interpreted as 3), but determine_number_system does not recognize that prefix.

I think I'll fix this myself soon-ish, but wanted to documented it first, in case I forget about it.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with du's block-size parsing and inspect parse_size_u64 and determine_number_system. Check the listed -B0, multiplier, and 0b11 cases, then confirm that zero no longer panics, multiplier distinctions are preserved, and binary-prefixed values are accepted.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.