Hi Patrick,
This seems to work ok to delete the tmp semaphore files.
If you're not too busy, have I missed anything out or can you suggest any
improvements?
<?php
/* delete files older than 5 mins */
$old = time()-300;
$dir = $_SERVER['DOCUMENT_ROOT']."/tmp";
$dh = opendir($dir);
while ($fname = readdir($dh)) {
if (filemtime($dir."/".$fname) < $old && $fname != "." && $fname != "..") {
unlink($dir."/".$fname);
}
}
closedir($dh);
?>
Bob.
----- Original Message -----
From: "Patrick Bierans" <[EMAIL PROTECTED]>
> The condition for deleting the semaphore-file is not well formed.
> If you only delete them if they were used you will soon have a lot of unused
> md5s filling your harddrive.
> Some people will open the form but not submit it.
> So delete all files older x minutes!
Community email addresses:
Post message: [email protected]
Subscribe: [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
List owner: [EMAIL PROTECTED]
Shortcut URL to this page:
http://groups.yahoo.com/group/php-list
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/php-list/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/