You are here: Re: Was a file accessed in the last 3 hours? « All PHP « IT news, forums, messages
Re: Was a file accessed in the last 3 hours?

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация