#process #sockets #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

#1958 in Filesystem

Download history 202/week @ 2025-10-09 148/week @ 2025-10-16 144/week @ 2025-10-23 307/week @ 2025-10-30 108/week @ 2025-11-06 250/week @ 2025-11-13 181/week @ 2025-11-20 208/week @ 2025-11-27 101/week @ 2025-12-04 197/week @ 2025-12-11 240/week @ 2025-12-18 139/week @ 2025-12-25 234/week @ 2026-01-01 98/week @ 2026-01-08 194/week @ 2026-01-15 39/week @ 2026-01-22

565 downloads per month
Used in earbuds

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
~42K SLoC