Linux, macOS and Windows, each x86_64 and aarch64, on native runners.
The release is drafted first and published once every build is in, so
a failed build never leaves a public release missing downloads. CI
tests the three architectures it did not run on before.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- The home directory comes from std::env::home_dir, which reads
USERPROFILE on Windows and HOME elsewhere.
- The root is canonicalized through dunce, so Windows paths read
C:\Users\... rather than \?\C:\..., the form nothing else is written
in and which would never match the home directory.
- A windowed program on Windows: no console window from Explorer or the
Start menu. It attaches to the console of a terminal it was started
from, as Alacritty does, so --help and errors still show there.
- Paths after ~ and the trail between crumbs use the platform's
separator: ~\AppData\Local, C:\ Users \ tobi.
disktree-core builds and measures on Windows. `windows.rs` holds what the
standard library does not give: a directory listing through
GetFileInformationByHandleEx with FileIdExtdDirectoryInfo, which carries
each entry's allocation and file id for a whole buffer of entries.
Opening every file for those two numbers made a walk of a home directory
of 1.3 million files seven times slower (65 s against 9 s); the listing
costs what FindNextFileW costs. Where a file system does not implement
it (a Samba share answers ERROR_INVALID_LEVEL), the walk falls back to
std's listing, with lengths.
- Disk usage is the NTFS allocation: whole clusters, less for a
compressed or sparse file, nothing for data kept in the file record.
- Hardlinks count once on NTFS, keyed by volume serial and file id. FAT
ids are documented as not unique and ReFS ids need all 128 bits, so
neither is used; there a hardlink counts once per name.
- Junctions and mounted folders are links, as std already treats them,
so the walk stays on one volume unless links are followed. The whole
disk is the drive the profile is on.
- Removal refuses Windows, Program Files, ProgramData and what Windows
keeps at the top of its drive, comparing names without case. A mounted
folder is a mount point. A link to a directory is removed with
RemoveDirectoryW, which leaves its target alone.
- Move to trash is the Recycle Bin, through the trash crate, which asks
the shell to warn before destroying anything it cannot recycle.
All unsafe code is in windows.rs, each block with the reason it is sound.
On Unix the walk reads the same metadata through the same calls.
- The README opens with a screenshot, and says how to install a release.
- CI lints and tests every push and pull request on a pinned toolchain.
- Pushing a v* tag builds a release on the oldest supported Ubuntu (for
glibc reach), checks the tag against Cargo.toml, runs the tests, and
publishes disktree-<version>-x86_64-linux.tar.gz with a checksum. The
archive carries install.sh, which installs the binary, desktop entry
and icon into ~/.local without a Rust toolchain.
- The desktop entry passes a path (%f), not a URI, to disktree.
A three-member workspace (core, app, xtask) with omatrack's lint policy:
clippy::all and clippy::pedantic are errors, nursery warns, and every
deliberate exception is listed with its reason. `cargo xtask lint` runs
rustfmt --check and clippy with -D warnings; it reports, never fixes.