Hi all
I'm trying to watch for a file being modified in a long running php script. The basic algorithm is this:
...
$mtime = filemtime($filename);
sleep($delay);
if($mtime < filemtime($filename))
... // do something because file was changed elsewhere
Problem is filemtime
returns the same value withing same script, e.g. if a script runs for say 10 minutes it will always get the same modification time regardless to actual changes done to the file within the same script or by other means.
Please help with an advice on how to actually get the latest modification time?