When I write to a file, the fileatime does not update - how can I get the
mod date to update when writing to the file?
//increment counter value by 1
$counter=file($ ctr);
$oldct=each($co unter);
$newct=$oldct[value]+1;
//write new value to viscounter file
$fp=fopen($ctr, "w");
if (flock($fp, LOCK_EX))
{
fwrite($fp, $newct);
flock($fp, LOCK_UN);
}
//if cd not get lock, don't count this hit
fclose($fp);
echo "counter = ".$newct." visit at ".fileatime($ct r);
// fileatime($ctr) stays the same...
mod date to update when writing to the file?
//increment counter value by 1
$counter=file($ ctr);
$oldct=each($co unter);
$newct=$oldct[value]+1;
//write new value to viscounter file
$fp=fopen($ctr, "w");
if (flock($fp, LOCK_EX))
{
fwrite($fp, $newct);
flock($fp, LOCK_UN);
}
//if cd not get lock, don't count this hit
fclose($fp);
echo "counter = ".$newct." visit at ".fileatime($ct r);
// fileatime($ctr) stays the same...
Comment