Crates.io | pentry |
lib.rs | pentry |
version | 0.1.1 |
source | src |
created_at | 2016-09-19 10:44:54.264815 |
updated_at | 2017-02-13 10:14:15.424558 |
description | Inspect Process ID and Executable File. |
homepage | |
repository | https://github.com/chikuchikugonzalez/pentry |
max_upload_size | |
id | 6544 |
size | 790,680 |
mitchellh/go-ps のようにプロセスの実行ファイルを取得したかった。
[dependencies]
pentry = "0.1.*"
extern crate pentry;
if let Ok(ps) = pentry::current() {
println!("{:?}", ps);
}
extern crate pentry;
if let Ok(ps) = pentry::current() {
println!("Current: {:?}", ps);
// 1. Use pentry::find
if let Ok(parent) = pentry::find(ps.ppid()) {
println!("Parent: {:?}", parent);
}
// 2. Use `parent` member function.
println!("Parent: {:?}", ps.parent().unwrap());
}
TANAKA Kenichi aka chikuchikugonzalez (ちくちく('ω')ごんざれす)