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

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

#1343 in Filesystem

Download history 149/week @ 2024-11-13 65/week @ 2024-11-20 94/week @ 2024-11-27 54/week @ 2024-12-04 121/week @ 2024-12-11 53/week @ 2024-12-18 56/week @ 2024-12-25 48/week @ 2025-01-01 185/week @ 2025-01-08 73/week @ 2025-01-15 57/week @ 2025-01-22 81/week @ 2025-01-29 119/week @ 2025-02-05 113/week @ 2025-02-12 98/week @ 2025-02-19 95/week @ 2025-02-26

440 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
~40K SLoC