File: README.md

package info (click to toggle)
rust-ofiles 0.2.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 140 kB
  • sloc: makefile: 2
file content (21 lines) | stat: -rw-r--r-- 783 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# ofiles

[![crates.io](https://img.shields.io/crates/v/ofiles.svg)](https://crates.io/crates/ofiles)
![Rust](https://github.com/jabedude/ofiles/workflows/Rust/badge.svg)
[![Documentation](https://docs.rs/ofiles/badge.svg)](https://docs.rs/ofiles/)
[![license](https://img.shields.io/badge/license-BSD3.0-blue.svg)](https://github.com/jabedude/ofiles/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:

```rust
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");
}
```