You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
du --inodes reports 0 for a lone directory (GNU: 1) and mixes byte counts into inode counts (4097 for a directory holding one file; GNU: 2) #1372
Probe-verified (same-source mingw+Wine harness, two runs, GNU coreutils 9.4). du --inodes (audit item I11; the hardlink faces of du are #1351, this is separate):
Empty directory d: du --inodes d → WinuxCmd prints 0 d; GNU prints 1 d (a directory counts itself).
Directory d containing one file: du --inodes d → WinuxCmd prints 4097 d; GNU prints 2 d. WinuxCmd's number looks like a disk-block total (4096) plus one — byte accounting leaks into inode mode.
Expected (GNU)
--inodes reports pure inode counts: every visited object, including each directory itself, contributes exactly 1.
Source
src/commands/du.cpp: the inode-count path initializes a directory's count at 0 instead of 1 and adds the block-usage accumulator into the reported value in directory totals.
Regression seed
In-repo test named with this issue number: both fixtures above, asserting 1 and 2.
Activity