https://github.com/jabedude/ofiles
Small library for associating processes and open files
https://github.com/jabedude/ofiles
filesystem processes sockets
Last synced: about 1 month ago
JSON representation
Small library for associating processes and open files
- Host: GitHub
- URL: https://github.com/jabedude/ofiles
- Owner: jabedude
- License: bsd-3-clause
- Created: 2020-04-23T19:59:47.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-02-26T00:47:02.000Z (over 1 year ago)
- Last Synced: 2025-04-03T01:11:07.700Z (2 months ago)
- Topics: filesystem, processes, sockets
- Language: Rust
- Homepage:
- Size: 30.3 KB
- Stars: 9
- Watchers: 2
- Forks: 5
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ofiles
[](https://crates.io/crates/ofiles)

[](https://docs.rs/ofiles/)
[](https://github.com/jabedude/ofiles/LICENSE)A tiny library for determining what process has a file/directory opened for reading/writing/etc.
I wrote this for another project but I hope will be useful in other applications.Example:
```rust
use ofiles::opath;let mut pids = opath("/path/to/a/file-or-directory").unwrap();
// Now we have a Vec of process ID's that have the `/path/to/a/file-or-directory` open
for pid in pids {
println!("Process {} has {} open!", pid, "/path/to/a/file-or-directory");
}
```