5 Commits
Author SHA1 Message Date
Oleg Shevchuk 5aa98e3818 app: run on Windows
- 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.
2026-09-25 15:09:18 +05:00
Oleg Shevchuk f3741c1a51 core: list, measure and remove on Windows
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.
2026-09-25 15:08:55 +05:00
Tobi Lutke bf6cbbfbee 0.9.1 2026-09-24 17:27:34 -06:00
Tobi Lutke 92f4031216 0.9.0: screenshot, CI, and release builds
- 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.
2026-09-24 17:13:38 -05:00
Tobi Lutke 406dda52d2 Workspace with strict lint gates
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.
2026-09-24 15:56:19 -05:00