README.md 890 Bytes
Newer Older
dns2utf8's avatar
dns2utf8 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
# linux_mount_options

[![crates.io](https://img.shields.io/crates/v/linux_mount_options?logo=rust)](https://crates.io/crates/linux_mount_options/)
[![docs.rs](https://docs.rs/linux_mount_options/badge.svg)](https://docs.rs/linux_mount_options)

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`:

```yaml
[dependencies]
linux_mount_options = "0"
```

In your `main.rs`:

```rust
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](https://crates.io/crates/log) you will get timestamped and formatted output.