#processes #sockets #process-file #lsof #fuser

ofiles

Identify processes that have opened files or sockets

3 unstable releases

0.2.0 Oct 22, 2020
0.1.1 Oct 15, 2020
0.1.0 Apr 24, 2020

#1262 in Filesystem

Download history 29/week @ 2024-07-20 33/week @ 2024-07-27 34/week @ 2024-08-03 425/week @ 2024-08-10 126/week @ 2024-08-17 69/week @ 2024-08-24 66/week @ 2024-08-31 137/week @ 2024-09-07 389/week @ 2024-09-14 88/week @ 2024-09-21 80/week @ 2024-09-28 121/week @ 2024-10-05 163/week @ 2024-10-12 258/week @ 2024-10-19 48/week @ 2024-10-26 80/week @ 2024-11-02

550 downloads per month
Used in 5 crates (2 directly)

BSD-3-Clause

13KB
229 lines

ofiles

crates.io Rust Documentation license

A tiny library for determining what process has a file 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 mut pids = opath("/path/to/a/file").unwrap();

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

Dependencies

~2MB
~39K SLoC