From ac0d41418e9639ca2d6d8c71ce499b108708b6af Mon Sep 17 00:00:00 2001 From: Michael Gapczynski Date: Wed, 22 Jun 2011 17:55:07 -0400 Subject: [PATCH] Correct calculation for shared folder size --- apps/files_sharing/sharedstorage.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/files_sharing/sharedstorage.php b/apps/files_sharing/sharedstorage.php index 4bb2ceb7c08..5b2ccbd4732 100644 --- a/apps/files_sharing/sharedstorage.php +++ b/apps/files_sharing/sharedstorage.php @@ -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) {