Posted by iuz on 06/03/05 02:47
Andrew @ Rockface wrote:
> Richard Quick wrote:
>> Hi,
>>
>> Is there a simple way to find out whether or not a file was last
>> updated/created/modified in the last 3 hours?
>>
>> Richard.
>
> http://uk2.php.net/manual/en/function.stat.php
>
or using directly the file[amc]time() functions
<?php
$files = `ls ./`;
$files = explode("\n", $files);
$tp = time() - 10800;
while (list(, $item) = each($files)) {
if (fileatime("./$item") > $tp OR
filemtime("./$item") > $tp OR
filectime("./$item") > $tp) {
echo "$item has been accessed and or modified and or changed (inode) in
the past three hours<br />";
}
}
?>
--
www.iuz-lab.info
Navigation:
[Reply to this message]
|