diff -ur horde-3.0.4/lib/VFS/sql.php horde/lib/VFS/sql.php
--- horde-3.0.4/lib/VFS/sql.php	2005-03-29 11:59:56.000000000 +0100
+++ horde/lib/VFS/sql.php	2005-04-02 22:45:29.000000000 +0100
@@ -387,6 +387,29 @@
         $files = array();
         $fileList = array();
 
+	// Check to see if the folder exists first
+	$dir =  substr($path,0,strrpos($path,'/'));
+	$name =  substr($path,strlen($dir)+1);
+        // Fix for Oracle not differentiating between '' and NULL.
+        if (empty($dir) && $this->_db->dbsyntax == 'oci8') {
+            $where = 'vfs_path IS NULL';
+        } else {
+            $where = 'vfs_path = ' . $this->_db->quote($dir);
+	}
+        $sql = sprintf('SELECT vfs_name, vfs_type, vfs_data, vfs_modified, vfs_owner FROM %s WHERE %s',
+                            $this->_params['table'],
+                            $where);
+        $this->log($sql, PEAR_LOG_DEBUG);
+        $fileList = $this->_db->getAll($sql);
+        if (is_a($fileList, 'PEAR_Error')) {
+            return $fileList;
+        } else if (empty($fileList)) {
+		return Pear::raiseError("Path $path/$name does not exist");
+	}
+
+        $files = array();
+        $fileList = array();
+
         // Fix for Oracle not differentiating between '' and NULL.
         if (empty($path) && $this->_db->dbsyntax == 'oci8') {
             $where = 'vfs_path IS NULL';
Only in horde-3.0.4/lib/VFS: .sql.php.swp
