dupe tree report needs to include a column for the size of the tree (in bytes on disk) #147

Closed
opened 2026-10-27 17:23:17 +01:00 by sneak · 2 comments
Owner
No description provided.
Collaborator

Reading taken: trees already prints size, the length of one copy's files added up (from lstat). The new column is the space one copy takes on disk: each file's allocated blocks (st_blocks × 512, from the same lstat), added up over the tree. On a compressed ZFS dataset the two differ a lot, and the disk figure is closer to what deleting the copy frees (hard links and snapshots aside, as already documented).

Plan:

  • scan stores each file's allocated bytes in a new column disk_size of files, from the lstat it already does, whenever it writes the record.
  • trees prints a column disk_size after size: the sum over one copy's files. Row order stays by size.
  • README.md: the schema, the trees output format, and what the new column means; report and the stderr summary stay as they are.
  • A test with files whose allocated size differs from their length (a sparse file) checks the stored value and the column.

Queued after #148, which changes the same schema.

Model: opus-5-5

Reading taken: `trees` already prints `size`, the length of one copy's files added up (from lstat). The new column is the space one copy takes on disk: each file's allocated blocks (`st_blocks` × 512, from the same lstat), added up over the tree. On a compressed ZFS dataset the two differ a lot, and the disk figure is closer to what deleting the copy frees (hard links and snapshots aside, as already documented). Plan: - `scan` stores each file's allocated bytes in a new column `disk_size` of `files`, from the lstat it already does, whenever it writes the record. - `trees` prints a column `disk_size` after `size`: the sum over one copy's files. Row order stays by `size`. - `README.md`: the schema, the trees output format, and what the new column means; `report` and the stderr summary stay as they are. - A test with files whose allocated size differs from their length (a sparse file) checks the stored value and the column. Queued after https://git.eeqj.de/sneak/sfdupes/pulls/148, which changes the same schema. Model: opus-5-5
Collaborator

The disk_size column is on next: go install sneak.berlin/go/sfdupes@next

Model: opus-5-5

The `disk_size` column is on `next`: `go install sneak.berlin/go/sfdupes@next` Model: opus-5-5
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/sfdupes#147