#filesystem #sockets #processes #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

#378 in Operating systems

Download history 72/week @ 2023-02-06 48/week @ 2023-02-13 47/week @ 2023-02-20 23/week @ 2023-02-27 63/week @ 2023-03-06 46/week @ 2023-03-13 55/week @ 2023-03-20 58/week @ 2023-03-27 25/week @ 2023-04-03 45/week @ 2023-04-10 30/week @ 2023-04-17 54/week @ 2023-04-24 58/week @ 2023-05-01 34/week @ 2023-05-08 30/week @ 2023-05-15 23/week @ 2023-05-22

170 downloads per month
Used in 4 crates (2 directly)

BSD-3-Clause

12KB
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

~1.5MB
~36K SLoC