inspect_path

Crates.ioinspect_path
lib.rsinspect_path
version0.1.0
created_at2026-01-25 06:52:21.665296+00
updated_at2026-01-25 06:52:21.665296+00
descriptionCross-platform inspection of filesystem paths, including local and remote mounts.
homepagehttps://github.com/Aurora4891/inspect_path
repositoryhttps://github.com/Aurora4891/inspect_path
max_upload_size
id2068270
size24,498
(Aurora4891)

documentation

README

inspect_path

inspect_path is a small cross-platform Rust crate for inspecting filesystem paths. It can determine whether a path refers to a fixed, removable, or remote filesystem, and can optionally probe whether that path is currently mounted or disconnected.

The crate works on both Windows and Unix-like systems and hides platform-specific details behind a simple, consistent API.


Features

  • Detects filesystem path type
    • Fixed disks
    • Removable media
    • Network / remote mounts
    • CD-ROM and RAM disks
  • Identifies remote filesystem types when possible
    • Windows shares (SMB / CIFS)
    • NFS
    • AFS
  • Allows probing a path to determine mount status
  • Platform-specific implementations with a shared public API

Platform Support

Windows

  • Fixed drives
  • Removable drives
  • CD-ROM drives
  • RAM disks
  • Network shares (UNC paths and mapped drives)

Unix / Linux

  • Local filesystems (ext4, xfs, btrfs, etc.)
  • Network filesystems (NFS, SMB/CIFS, AFS)
  • tmpfs and optical media
  • Uses filesystem magic numbers via statfs

Some filesystem details cannot be inferred on all platforms (for example, Linux cannot always distinguish NTFS backing devices).


Usage

Inspecting a path

use std::path::Path;
use inspect_path::inspect_path;

let info = inspect_path(Path::new(r"C:\")).unwrap();

if info.is_fixed() {
    println!("This is a fixed filesystem");
}
Commit count: 12

cargo fmt