How to know whether a particular file is opened or not?
I have a query regarding Linux files. I would like to know whether a particular file is opened by a process or not?
I have a way to check by getting the process the process id from PS and then chekcing the proc filesystem. But my idea is to check whether the file is opened by any other process or not, to induce locking.
Is there any way to check for the same?