In PHP, how can I test if a file has already been locked with flock? For example, if another running script has called the following:
$fp = fopen('thefile.txt', 'w');
flock($fp, LOCK_EX);
In PHP, how can I test if a file has already been locked with flock? For example, if another running script has called the following:
$fp = fopen('thefile.txt', 'w');
flock($fp, LOCK_EX);
if(stream_get_meta_data($fp)['blocked'])
echo 'file is locked';
else
echo 'file is not locked';