Example #1
0
 /**
  * Read a directory
  *
  * @access public
  *
  * @param $path file path
  * @param $retval file name array of files in the directory
  */
 function getdir($path, &$retval)
 {
     $passthruRetval = array();
     $dbmountRetval = array();
     Log::in("GETDIR {$path}");
     /* Check for passthru, if we are in passthru just return
      * the passthru files, not any db mounted files. 
      */
     if (PassThru::check($path)) {
         $ret = PassThru::getdir($path, $retval);
     } else {
         /* Need to get both the passthru directory files and
          * the db mounted directory files and merge them, so the user
          * sees a combined view of the two seperate file systems in
          * the db mount.
          */
         $passthruPath = PassThru::getpassthrupath($path);
         $ret = PassThru::getdir($passthruPath, $passthruRetval);
         if ($ret != 0) {
             Log::out("GETDIR - failed to get passthru files");
             return -FUSE_EIO;
         }
         $pi = Query::pathInfo($path);
         $ret = Query::getdir($pi, $dbmountRetval);
         if ($ret != 0) {
             Log::out("GETDIR - failed to get db mount files");
             return -FUSE_EIO;
         }
         /* OK, merge the arrays */
         $retval = array_merge_recursive($dbmountRetval, $passthruRetval);
     }
     Log::out("GETDIR");
     return $ret;
 }