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 &
Use fuser. It returns non-zero if any of the files specified are in use, and zero if they're all available.
fuser