--- framework/VFS/lib/VFS/smb.php.orig	2008-05-20 11:17:15.000000000 +0300
+++ framework/VFS/lib/VFS/smb.php	2008-11-27 13:40:32.000006000 +0200
@@ -72,6 +72,49 @@
         return true;
     }
 
+
+
+    /**
+     * Returns the size of a share.
+     *
+     * @access public
+     *
+     * @param string $path  The path of the file.
+     * @param string $name  The filename.
+     *
+     * @return integer  The size of the folder in bytes or PEAR_Error on
+     *                  failure.
+     */
+    function getFolderSize($path = '', $name = null)
+    {
+        list($path) = $this->_escapeShellCommand($path);
+        $cmd = array('ls');
+        $res = $this->_command($path, $cmd);
+        if (is_a($res, 'PEAR_Error')) {
+            return $res;
+        }
+        $num_lines = count($res);
+        for ($r = 0; $r < $num_lines; $r++) {
+            if (preg_match('/blocks of size/', $res[$r])) {
+                $block_total = preg_replace('/^\s+(\d+)\s+blocks of size.*/', '\1', $res[$r]);
+                $block_size = preg_replace('/^.*blocks of size\s+(\d+).*/', '\1', $res[$r]);
+                $block_avail = preg_replace('/^.*\s+(\d+)\s+blocks available.*/', '\1', $res[$r]);
+                is_numeric($block_total)? 1 : $block_total = 0;
+                is_numeric($block_size)? 1 : $block_size= 0;
+                is_numeric($block_avail)? 1 : $block_avail = 0;
+                $size = ($block_total - $block_avail) * $block_size;
+            }
+        }
+
+        if ((!empty($block_total)) && (!empty($block_size))) {
+            $this->_params['vfs_quotalimit'] = $block_total * $block_size;
+        }
+
+        return empty($size)? 0 : $size;
+    }
+
+
+
     /**
      * Retrieves a file from the VFS.
      *