How to check if a file is already open by another process in C?

前端 未结 8 519
感情败类
感情败类 2020-12-03 15:08

I see that standard C has no way of telling if a file is already opened in another process. So the answer should contain several examples for each platform. I need that chec

8条回答
  •  生来不讨喜
    2020-12-03 15:29

    The answers so far should tell you that finding out the information you've asked for is tricky, non-portable, and often inherently unreliable. So, from my perspective, the real answer is don't do that. Try to find a way to think about your real problem so that this question doesn't arise.

提交回复
热议问题