#mount-point #system #detect #folder #process #access

linux_mount_options

Detect file system, mount point and noatime of a folder the process has access to

1 unstable release

0.1.0 Jul 22, 2020

#1448 in Filesystem

MIT/Apache

8KB
171 lines

linux_mount_options

crates.io docs.rs

Detect file system, mount point and noatime of a folder the process has access to.

Requirements

  • Access to /proc/mounts
  • Linux tested
    • It should work on *BSD. However, it is not tested.

Example:

First, add it to your Cargo.toml:

[dependencies]
linux_mount_options = "0"

In your main.rs:

fn main() -> Result<(), Box<dyn Error>> {
    let path = "/home";
    let info = linux_mount_options::detect(&path)?;
    println!("{}: {:?}", path, info);
    Ok( () )
}

If you are using logging based on the log infrastructure you will get timestamped and formatted output.

Dependencies

~89KB