bin+lib pentry

Inspect Process ID and Executable File

2 releases

Uses old Rust 2015

0.1.1 Feb 13, 2017
0.1.0 Sep 19, 2016
Download history 38/week @ 2024-07-29 12/week @ 2024-08-05 5/week @ 2024-08-19 2/week @ 2024-08-26 18/week @ 2024-09-09 2/week @ 2024-09-16 24/week @ 2024-09-23 16/week @ 2024-09-30 97/week @ 2024-10-07 65/week @ 2024-10-14 4/week @ 2024-10-28 24/week @ 2024-11-04

97 downloads per month

MIT license

590KB
332 lines

Contains (WOFF font, 120KB) docs/Heuristica-Italic.woff, (WOFF font, 90KB) docs/FiraSans-Medium.woff, (WOFF font, 92KB) docs/FiraSans-Regular.woff, (WOFF font, 56KB) docs/SourceCodePro-Regular.woff, (WOFF font, 56KB) docs/SourceCodePro-Semibold.woff, (WOFF font, 49KB) docs/SourceSerifPro-Bold.woff and 1 more.

pentry: Process Entry Inspection Library for Rust

mitchellh/go-ps のようにプロセスの実行ファイルを取得したかった。

使い方 - Usage -

依存関係の追加 - Add Dependencies -

[dependencies]
pentry = "0.1.*"

サンプルコード - Samples -

自分自身を取得するサンプル - Inspect SELF process -

extern crate pentry;

if let Ok(ps) = pentry::current() {
    println!("{:?}", ps);
}

親プロセスを取得する - Inspect Parent Process -

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());
}

作者 - Author -

TANAKA Kenichi aka chikuchikugonzalez (ちくちく('ω')ごんざれす)

ライセンス - LICENSE -

MIT License

Dependencies

~2.5MB
~39K SLoC