[phpcvsview-cvs-updates] phpcvsview func_ArchiveDownload.php,1.1,1.2
Status: Pre-Alpha
Brought to you by:
bcheesem
From: Brian C. <bch...@us...> - 2005-02-04 04:45:03
|
Update of /cvsroot/phpcvsview/phpcvsview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27103 Modified Files: func_ArchiveDownload.php Log Message: Added the forgotten cleanup of the temporary location. Index: func_ArchiveDownload.php =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/func_ArchiveDownload.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** func_ArchiveDownload.php 4 Feb 2005 04:21:52 -0000 1.1 --- func_ArchiveDownload.php 4 Feb 2005 04:44:47 -0000 1.2 *************** *** 58,61 **** --- 58,89 ---- } + function rmdirr($dirname) + { + // Sanity check + if (!file_exists($dirname)) { + return false; + } + + // Simple delete for a file + if (is_file($dirname)) { + return unlink($dirname); + } + + // Loop through the folder + $dir = dir($dirname); + while (false !== $entry = $dir->read()) { + // Skip pointers + if ($entry == '.' || $entry == '..') { + continue; + } + + // Recurse + rmdirr("$dirname/$entry"); + } + + // Clean up + $dir->close(); + return rmdir($dirname); + } function DownloadArchive() { *************** *** 90,94 **** // Dump the contents of the file to the client. fpassthru($tarfile); ! } --- 118,122 ---- // Dump the contents of the file to the client. fpassthru($tarfile); ! rmdirr($jobpath); } |