function pathSize($dir) { $filesize = 0; if (is_dir($dir)) { if ($fp = @opendir($dir)) { while ($filename = readdir($fp)) { if ($filename != '.' and $filename != '..') { //echo "check: '$dir/$filename'<br>"; if (is_dir($dir . "/" . $filename) === true) { $filesize += pathSize($dir . "/" . $filename); } else { $filedata = stat($dir . "/" . $filename); $filesize += $filedata[7]; } } } return $filesize; /*Gesamtgr��e des Inhaltes des Verzeichnisses $dir in Bytes*/ } else { return false; } } else { return false; } }
function create_size_row($path_id) { $path = $_SESSION["lisa_path"] . "/" . $_SESSION["settings"][$path_id]; $size = round(pathSize($path) / 1024 / 1024, 2); return "<tr><td>Size of ({$path_id}) '{$path}' </td><td> {$size} MByte</td></tr>"; }