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.
3.5 KiB
bigfind — util_boxgui (C++ / LightGUI)
A LightGUI front-end for the bigfind CLI utility from
util_box (src/bigfind.c): find the
top-N largest files in a directory tree, with age, type and parent-directory
context for each hit.
Walkthrough: https://cdoc.lightgui.com/bigfind/
What it does
Type (or keep) a directory path, pick how many hits to show with the Top N spinbox, and press Run. The table lists the N largest files in the tree, largest first, with five columns:
| Column | Meaning |
|---|---|
| Size | Human-readable size (202.8 KiB, 23.7 MiB — same format as the CLI) |
| Age | Time since last modification (23h, 1d, 2mo, 3y — same format as the CLI) |
| Type | Lowercased file extension, (none) when there is none |
| File | File name |
| Parent dir | Directory the file lives in |
The status line under the table mirrors the CLI summary, e.g.
top 10 of 1824 files; tree total 23.7 MiB.
On launch the app is already in a meaningful state: it scans
/root/fileutils with N=10, so the table is populated immediately.
Build
make
One g++ line (see Makefile):
g++ -std=c++17 -I/root/lg-review/lightgui/widgets/components -I/root/lg-review/lightgui/widgets -O2 -Wall bigfind.cpp -lX11 -o bigfind
Builds clean with no warnings. Needs g++, libx11-dev and the LightGUI
checkout at /root/lg-review/lightgui (header-only widgets on raw X11).
Run
Under a real X server, or under Xvfb:
Xvfb :98 -screen 0 1024x768x24 &
DISPLAY=:98 ./bigfind
Close the window to quit. Changing the path (Enter) or the Top N value re-runs the scan; the Run button re-scans the current path and N.
How it maps to the CLI
The scan logic in bigfind.cpp is a direct port of util_box's
src/bigfind.c (bigfind [dir] [-n N]):
- Traversal: one recursive walk (
opendir/readdir), following the same rules — directories are recursed into, regular files are considered, everything else (symlinks, sockets, devices) is skipped, unreadable directories are silently skipped. - Top-N: only the N largest files are kept (bounded memory); a file only displaces the current smallest when it is strictly larger — same rule as the CLI's heap.
- Sort: largest first by byte size.
- Formatting:
human()(%.1f+ B/KiB/MiB/GiB/TiB) andage_str()(59s,12m,23h,6d,3mo,2y) are copied verbatim, andext_ofreproduces the CLI's quirk of taking the last.in the whole path, lowercased and capped at 31 characters — so extensionless files under dotted directories (e.g..git/objects/…) report odd "types" exactly as the CLI does. - Differences: the GUI has no
--min-sizeor--jsonoptions (the table shows the same columns the CLI prints); the CLI's two-line hit layout (PATH+in <parent>) is split into the File and Parent dir columns.
Verified against the CLI on the same inputs (/root/fileutils, N=10): the
GUI's table matches /root/fileutils/bin/bigfind /root/fileutils -n 10
exactly — same 10 files, same sizes, same order, same totals
(1824 files, 23.7 MiB). The app also echoes each scan to stdout in CLI
form, so the comparison can be re-run by diffing its output against the CLI.
Files
bigfind.cpp— the app (scan logic + LightGUI widgets)Makefile— the buildscreenshot.png— real Xvfb capture of the running GUI (default state)README.md— this file