note 13592 deleted from function.disk-total-space by irc-html
| From: | irc-html@php.net | Date: | Thu, 03 Jan 2002 02:24:47 +0000 |
| Subject: | note 13592 deleted from function.disk-total-space by irc-html | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-24332@lists.php.net to get a copy of this message | ||
well, I tried to test this function and it doesn't seem to exist. so I wrote my own!
/*$dir is the dir name you want the size of. this is not recursive. it only gives you size of files
+ folders (512)*/
function dirsize($dir)
{
$handle=opendir($dir);
$size = 0;
while (($file = readdir($handle))!==false)
{
if ( ($file != ".") && ($file != ".."))
{
$path = $dir . "/" . $file;
echo "$file size = " . filesize($path) . "<br>";
$size += filesize($path);
}
}
closedir($handle);
return $size;
}