note 13592 added to function.disk-total-space.php
| From: | shahabi at noSPAM dot yahoo dot com | Date: | Fri, 22 Jun 2001 20:43:12 +0000 |
| Subject: | note 13592 added to function.disk-total-space.php | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-14574@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;
}
http://www.php.net/manual/en/function.disk-total-space.php