Perl: the Markov chain saw | |
PerlMonks |
Re: Is file still open ?by Thelonius (Priest) |
on May 15, 2006 at 13:09 UTC ( [id://549483]=note: print w/replies, xml ) | Need Help?? |
Your LOCK_EX is probably failing because you only have the file opened for reading. Some operating systems require you to have the file open for writing to do LOCK_EX. But, as cdarke notes, locking won't tell you anything unless the other process is locking, too.
Some versions of Unix (and Linux) support the fuser command. FreeBSD has the fstat command. On some versions of Unix, there's no way to tell! On most (I think all) Unixes, you can kill(pid, 0) to see if pid exists.
In Section
Seekers of Perl Wisdom
|
|