Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 1
    fcntl on Linux does, indeed, have lots of additional capabilities (compared to other Unixes), but none of them seem to help me here... Leases and locks come closest, but not close enough -- did you have something else in mind? Commented May 8, 2021 at 20:25
  • I updated my answer with more details to address your problem. Commented May 10, 2021 at 7:15
  • 3
    I think he's looking to find if a file is open, probably in another process, and not if a file descriptor is open in the current process Commented May 10, 2021 at 8:34
  • I see. I missunderstood. In this case there are already answers here: unix.stackexchange.com/questions/333186/… and here: unix.stackexchange.com/questions/66235/… Commented May 10, 2021 at 11:59
  • No, @2419, the questions you referenced aren't "mine". The first one, again, lists filedescriptors opened by the current bash -- I'm looking for other processes having the specified file open for writing. The second question is about the total number of opened files... Commented May 10, 2021 at 14:27