Thanks to visit codestin.com
Credit goes to lib.rs

11 releases

0.1.2 Dec 17, 2025
0.1.1 Nov 12, 2025
0.1.0 Sep 12, 2025
0.0.11 Jun 29, 2025
0.0.6 Oct 17, 2024

#362 in Filesystem

MIT license

49KB
1K SLoC

gpscan

Cargo Build & Test Crates.io Crates.io Lines of Code

Scan your filesystem and get an XML file compatible with GrandPerspective on macOS to visualize disk usage.

  • Recursively scans directories and files
  • Generates XML output compatible with GrandPerspective
  • Skips symbolic links to prevent infinite loops
  • Handles file permissions and errors

Installation

Downloading

You can download prebuilt binaries in the GitHub Releases.

Building

cargo install gpscan

Usage

Basic usage

gpscan [OPTIONS] <directory>

Typical commands:

# File output (gzip by default, .gpscan is auto-appended)
gpscan . -o result

# Plain text file output (no gzip)
gpscan . -o result --no-gzip

# Gzip to stdout (useful for piping/redirect)
gpscan . -z > result.gpscan

Then open the generated file in GrandPerspective.

Notes:

  • File output (-o) defaults to gzip and adds the .gpscan suffix automatically.
  • When the target file already exists: in TTY, a prompt asks to overwrite; in non-interactive mode, use --force.

Options

  -o, --output <FILE>            Output file (gzip by default, adds .gpscan)
  -A, --apparent-size            Use apparent size instead of disk usage
  -m, --mounts                   Cross filesystem boundaries during scan
  -Z, --zero-files               Include zero-byte files in scan
  -E, --empty-folders            Include empty folders in scan
  -q, --quiet                    Suppress all informational messages
  -z, --gzip                     Gzip-compress stdout (file output is gzip by default)
      --compression-level <0-9>  Gzip level for output (default: 6)
      --no-gzip                  Disable gzip for file output
  -f, --force                    Overwrite output file without prompt
  -h, --help                     Print help
  -V, --version                  Print version

Environment Variables

  • RUST_LOG: Set logging level (e.g., RUST_LOG=debug gpscan /path)

Platform Notes

  • Windows: Physical file size calculation uses estimated 4KB cluster size
  • Linux/macOS: Uses actual filesystem block information for accurate physical sizes

Development

git clone https://github.com/kojix2/gpscan.git
cd gpscan
cargo build --release

License

MIT

This project includes code generated by AI tools.

Dependencies

~6MB
~99K SLoC