| Crates.io | linux-procfs |
| lib.rs | linux-procfs |
| version | 0.3.17 |
| created_at | 2021-07-01 13:25:27.393757+00 |
| updated_at | 2025-09-25 03:23:15.918263+00 |
| description | The linux-procfs is the data snap library for the `/proc/` filesystem on the linux os. |
| homepage | |
| repository | https://github.com/aki-akaguma/linux-procfs |
| max_upload_size | |
| id | 417438 |
| size | 1,671,952 |
The linux-procfs crate is the data snap library for the /proc/ filesystem on the linux os.
This crate reads from /proc filesystem, scanne it, stores the value into the struct and returns it. This scans and holds only the required values by specifying feature.
use linux_procfs::System;
let mut sys = System::new("/");
let loadavg = sys.get_loadavg();
println!("{}, {}, {}, {}", loadavg.a1, loadavg.a5, loadavg.a15, loadavg.last_pid);
use linux_procfs::System;
let mut sys = System::new("/");
let diskstats = sys.get_diskstats();
for disk in diskstats.disks {
println!("{}, {}, {}", disk.name, disk.rblk, disk.wblk);
}
This project is licensed under either of
at your option.