On Tue, 23 Dec 2003 19:08:28 -0800 (PST), you wrote:

>>How can I unlink files in a directory that are, for example older than 1
>>hour?
>
>`find /path/to/dir -cmin +60 -type f -print0 | xargs -0 rm -f`;

Alternatively, for cross-platformness user opendir() and readdir() to
iterate over the directory, stat() or filemtime() to grab the last-modified
time of the file, and unlink() to remove files where ($last_modified <
time() - 3600).

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to