note 57392 deleted from function.filesize by aidan
| From: | aidan@php.net | Date: | Wed, 09 Nov 2005 06:15:08 +0000 |
| Subject: | note 57392 deleted from function.filesize by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-98302@lists.php.net to get a copy of this message | ||
Note Submitter: laurent dot devivie at onweb dot fr
----
I haven't found anything like this - but needed to calculate the size of a directory - this one
is pretty basic but usefull...
function directory_size($nomrep){
$dossier = @opendir($nomrep);
$file_size_up = 0;
while ($Fichier = @readdir($dossier)){
if ($Fichier != "." && $Fichier != ".."){
if ($Fichier){
$file_size_up += filesize($nomrep."/".$Fichier);
}
}
}
@closedir($dossier);
return $file_size_up;
}