I'm trying to test a single file if it is open using lsof. Is there a faster way than this?
$result = exec('lsof | grep filename | wc -l');
if($result > 0) {
//file is open
}
I'm thinking their must be a way to just test for one file if you know the filename. All I really need is a true or false.