First 3 of the 5 pilot apps, all built and screenshot-tested on hot_dallas: - banner (Python): text + font combo + scrolling output, 12/12 GUI-vs-CLI - bigfind (C++): top-N largest files table, exact CLI match - emptybig (C++): sparse-file finder, exact CLI match on fixture Top-level README indexes all 50 drawn apps; LICENSE is MIT (util_box itself is unlicensed; MIT matches lzply and lightgui). datecalc and certcheck are blocked pending execution-risk approval.
emptybig — util_boxgui (C++ / LightGUI)
LightGUI front end for the emptybig utility from util_box. It finds large
files that are mostly zeros — sparse files and zero-filled files — under a
directory tree, and shows them in a table sorted by size, largest first.
A file flagged here is a candidate for truncation, punching holes with
fallocate -d, or deletion: it reserves far more space than it holds.
What it does
- Path — the directory tree to scan (scanned recursively).
- Min size — only files at least this large are considered (default
1M; acceptsK,M,Gsuffixes, same as the CLI). - Min zero % — a non-sparse file is flagged when at least this percent of
its sampled bytes are zero (default
50). - Scan — re-runs the scan with the current path and thresholds.
- The table shows the same columns as the CLI: SIZE, ON DISK, ZERO%, FILE, plus a summary line with the file count and the apparent waste (size minus on-disk bytes, summed over all hits).
The scan runs once on launch, so the table is populated immediately.
How it maps to the CLI
The detection logic is a direct port of /root/fileutils/src/emptybig.c
(util_box, HEAD 46e027c), same scan, same tests, same output values:
- Only regular files are considered; symlinks are skipped; directories are walked recursively.
- A file is sparse when its on-disk blocks use less than half its size
(
st_blocks * 512 * 2 < st_size); sparse files are flagged with ZERO% 100. - Otherwise up to 16 blocks of 64 KiB spread across the file are sampled, and the file is flagged when the zero fraction is at least the min-zero threshold.
- Results are sorted by size, largest first, and sizes use the same human
formatting as the CLI (
5.0M,2.0M,0B). - CLI flags:
[PATH]maps to the Path field,--min-size SIZEto Min size,--min-zero PCTto Min zero %.
Build
make
One g++ line (see Makefile):
g++ -std=c++17 -I/root/lg-review/lightgui/widgets/components -I/root/lg-review/lightgui/widgets emptybig.cpp -lX11 -o emptybig
Requires g++, libx11-dev, and the LightGUI checkout at
/root/lg-review/lightgui (widgets are header-only C++ on raw X11).
Run
Under Xvfb (display :101 is the one used for this app):
Xvfb :101 -screen 0 1024x768x24 &
DISPLAY=:101 ./emptybig
Or on a real X server, just ./emptybig.
Default state and test fixture
The app starts with Path /tmp/emptybig-test, Min size 1M, Min zero 50%,
and scans on launch. No directory on hot_dallas with real matches was found
(a scan of /root found 0 files), so the default points at a test fixture
with known sparse files. Recreate it with:
mkdir -p /tmp/emptybig-test
truncate -s 5M /tmp/emptybig-test/sparse.bin
dd if=/dev/zero of=/tmp/emptybig-test/zeros.bin bs=64K count=32
dd if=/dev/urandom of=/tmp/emptybig-test/dense.bin bs=64K count=32
sparse.bin (5 MB, nothing written) and zeros.bin (2 MB of zeros) are
flagged; dense.bin (2 MB of random bytes) is correctly ignored. The CLI
agrees exactly on this fixture:
large mostly-empty files in /tmp/emptybig-test (min size 1.0M, min zero 50%):
SIZE ON DISK ZERO% FILE
5.0M 0B 100% /tmp/emptybig-test/sparse.bin
2.0M 2.0M 100% /tmp/emptybig-test/zeros.bin
2 file(s); apparent waste vs on-disk: 5.0M
Walkthrough
Planned walkthrough article: https://cdoc.lightgui.com/emptybig/
Notes
- The LightGUI
GtkEntrywidget does not implement Ctrl+A select-all, so clear the Path field with End + Backspace before typing a new path. - The result grid shows at most 200 rows; the summary line always reports the full hit count.