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

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

#1065 in Filesystem

Download history 21/week @ 2024-01-14 15/week @ 2024-01-21 3/week @ 2024-01-28 20/week @ 2024-02-04 22/week @ 2024-02-11 22/week @ 2024-02-18 44/week @ 2024-02-25 25/week @ 2024-03-03 61/week @ 2024-03-10 90/week @ 2024-03-17 32/week @ 2024-03-24 96/week @ 2024-03-31 24/week @ 2024-04-07 26/week @ 2024-04-14 24/week @ 2024-04-21 24/week @ 2024-04-28

114 downloads per month
Used in 4 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
~38K SLoC