Hwatwasthat / proc-mounts

Rust crate for fetching active mounts and swaps on a Linux system

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

proc-mounts

Rust crate that provides easy access to data from the /proc/swaps and /proc/mounts files.

extern crate proc_mounts;

use proc_mounts::{MountIter, SwapIter};
use std::io;

fn main() -> io::Result<()> {
    println!("# Active Mounts");
    for mount in MountIter::new()? {
        println!("{:#?}", mount);
    }

    println!("# Active Swaps");
    for swap in SwapIter::new()? {
        println!("{:#?}", swap);
    }

    Ok(())
}

About

Rust crate for fetching active mounts and swaps on a Linux system

License:MIT License


Languages

Language:Rust 100.0%