timvisee / ofiles

Small library for associating processes and open files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ofiles

crates.io Rust Documentation license

A tiny library for determining what process has a file/directory opened for reading/writing/etc. I wrote this for another project but I hope will be useful in other applications.

Example:

use ofiles::opath;

let path = "/path/to/a/file-or-directory";
let pids = opath(path).unwrap();

// Now we have a Vec of process ID's that have the `/path/to/a/file-or-directory` open
for pid in pids {
    println!("Process {:?} has {} open!", pid, path);
}

About

Small library for associating processes and open files

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Rust 100.0%