I want to know if a deterministic file is used by process, i.e. if the file is open in read-only mode by this process.
I was thinking about searching through the / Proc / [PID] / [FD] directory, but this way I spend a lot of time, and I think doing it is not beautiful.
Can any Linux API be used to determine if an X file is open by a process? Or maybe some structure data like / proc, but for files?
Leber source share