fcntl has an F_GETLK flag which will tell if the file would have been locked without actually locking it (although it isn't documented it does appear in the code, you could check the fcntl(2) man page for information on how it works in C), but if you are checking something that can't deal with a split second lock, and it only uses flock, you may just be out of luck.
| We're not surrounded, we're in a target-rich environment! |
|---|
In reply to Re: Check if file is locked without locking it
by jasonk
in thread Check if file is locked without locking it
by perlplexer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |