9 releases
0.3.0 | Mar 21, 2022 |
---|---|
0.2.4 | Apr 9, 2020 |
0.2.3 | Nov 8, 2019 |
0.2.2 | Feb 20, 2019 |
0.1.0 | Nov 2, 2018 |
#230 in Unix APIs
24,913 downloads per month
Used in 26 crates
(14 directly)
24KB
531 lines
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(())
}
lib.rs
:
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(())
}
Dependencies
~275–730KB
~17K SLoC