Skip to content

pop-os/proc-mounts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages