<?php
	// cleanup.php	this file is part of the
	// Font Lister v0.2 by Tuxman < tuxman@gamersirc.net >
	
	// set cleanup period
	$cleanup_period = 60 * 60 * 24 * 3;	// 3 days
	
	//  let's have an overview over all /files ...
	$dir = "files";	
	$files = scandir($dir);
	
	// let's check the last access timestamps ...
	foreach($files as $filetmp) {
		if ($filetmp == "." || $filetmp == "..")
			continue;
		
		$timestamp = fileatime($dir . "/" . $filetmp);
		$now = time();
		
		if ($now - $timestamp >= $cleanup_period)
			@unlink($dir . "/" . $filetmp);	// delete it :-)
	}
	
	clearstatcache();
?>