Crates.io | process_list |
lib.rs | process_list |
version | 0.2.1 |
source | src |
created_at | 2020-01-12 17:34:03.879706 |
updated_at | 2020-01-18 23:31:07.341444 |
description | Crate for listing the processes open in the OS, usually for retrieving their ID by their name. |
homepage | |
repository | https://github.com/mgostIH/process_list |
max_upload_size | |
id | 197868 |
size | 15,501 |
This crate exposes functionalities for dealing with processes and modules loaded inside them in a streaming manner.
This crate exposes a for_each_process
function to deal sequentially with every process open in the operating system.
Printing every process to stdout
use std::path::{Path, PathBuf};
use process_list::for_each_process;
fn print_processes(id : u32, name : &Path) {
println!("Id: {} --- Name: {}", id, name.display());
}
for_each_process(print_processes).unwrap();
This crate exposes a for_each_module
function to deal sequentially with every module loaded in a process.
Printing every module loaded in the current process to stdout
use process_list::for_each_module;
use std::process;
fn print_stuff() {
env_logger::init();
for_each_module(process::id(), |(address, size), name| {
println!("{:016X} - {} \t {}", address, size, name.display())
})
.unwrap();
}
You can enable the log
feature of this crate in order to get logging from it.
For now only Windows is supported, but it should be simple enough to port on other operating systems.
It's not a priority but pull requests are well accepted.