If the other application (OA) is using file locking then flock() is the correct way. You first open() the filehandle. (There is no harm in this even if the OA is using the file.) Then you call flock() to attempt to acquire the write permission to the file. The return status tells you whether the file has been locked ('in use') by an OA.
If the other application is using some proprietary locking scheme then of course you have to deduce what that scheme is.
In reply to Re^3: Finding if a file is open
by starbolin
in thread Finding if a file is open
by merrymonk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |