<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Code The World — Temp FIles]]></title>
	<link rel="self" href="https://codetheworld.com/extern.php?action=feed&amp;tid=60&amp;type=atom" />
	<updated>2008-06-16T05:38:16Z</updated>
	<generator>PunBB</generator>
	<id>https://codetheworld.com/viewtopic.php?id=60</id>
		<entry>
			<title type="html"><![CDATA[Re: Temp FIles]]></title>
			<link rel="alternate" href="https://codetheworld.com/viewtopic.php?pid=229#p229" />
			<content type="html"><![CDATA[<p>hey not bad dude...i will definatly need to check this out</p>]]></content>
			<author>
				<name><![CDATA[fecal]]></name>
				<uri>https://codetheworld.com/profile.php?id=263</uri>
			</author>
			<updated>2008-06-16T05:38:16Z</updated>
			<id>https://codetheworld.com/viewtopic.php?pid=229#p229</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Temp FIles]]></title>
			<link rel="alternate" href="https://codetheworld.com/viewtopic.php?pid=149#p149" />
			<content type="html"><![CDATA[<p>I wanted a way to delete my temp files that are old so i came up with</p><div class="codebox"><pre><code>// Define the folder to clean
// (keep trailing slashes)
$captchaFolder  = &#039;temp/&#039;;
 
// Filetypes to check (you can also use *.*)
$fileTypes      = &#039;*.jpg&#039;;
 
// Here you can define after how many
// minutes the files should get deleted
$expire_time    = 20; 
 
// Find all files of the given file type
foreach (glob($captchaFolder . $fileTypes) as $Filename) {
 
    // Read file creation time
    $FileCreationTime = filectime($Filename);
 
    // Calculate file age in seconds
    $FileAge = time() - $FileCreationTime; 
 
    // Is the file older than the given time span?
    if ($FileAge &gt; ($expire_time * 60)){
 
        // Now do something with the olders files...
 
        print &quot;The file $Filename is older than $expire_time minutes\n&quot;;
 
        // For example deleting files:
        //unlink($Filename);
    }
 
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Hornet]]></name>
			</author>
			<updated>2008-06-15T14:24:17Z</updated>
			<id>https://codetheworld.com/viewtopic.php?pid=149#p149</id>
		</entry>
</feed>
