caido / process_alive

Cross platform library to verify if a process is alive

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Process Alive

github crates.io

This is a small cross platform crate to check if a process is alive. Inspired by sysinfo, but without the need to parse through all the processes to verify one. Since there can be some errors related to permissions, the state can be Unknown and you can decide how you want to handle it.

use process_alive::{State, Pid};

pub fn main() {
  let pid = Pid::from(1234);
  let state = process_alive::state(pid);
  println("Process {} is {}", pid, state);
}

About

Cross platform library to verify if a process is alive

License:MIT License


Languages

Language:Rust 100.0%