Correct calculation for shared folder size

This commit is contained in:
Michael Gapczynski 2011-06-22 17:55:07 -04:00
parent 18e776fa2f
commit ac0d41418e
1 changed files with 6 additions and 3 deletions

View File

@ -128,11 +128,14 @@ class OC_FILESTORAGE_SHARED {
}
// TODO Get size of shared directory
public function filesize($path) {
echo "filesize";
if ($path == "" || $path == "/") {
return 10000;
$size = 0;
$dir = OC_FILESTORAGE_SHARED::opendir($path);
while (($filename = readdir($dir)) != false) {
$size += OC_FILESTORAGE_SHARED::filesize($filename);
}
return $size;
} else {
$source = OC_SHARE::getSource($path);
if ($source) {