/** * Make a file node * * @access public * * @param $path path information * @param $mode the file mode */ public static function mknod($path, $mode) { Log::in("passthru - mknod"); $retarray = array(); /* First create the directory path needed for the file * or directory creation. */ PassThru::_makePath($path, $mode); /* Check for a file or directory */ if (is_dir($path)) { if (mkdir($path, $mode) === false) { Log::out("passthru - mknod - failed to create directory"); return -FUSE_ENOENT; } } else { /* Just 'touch' the file and chmod it */ if (touch($path) === false) { Log::out("passthru - mknod - failed to create file"); return -FUSE_ENOENT; } if (chmod($path, $mode) === false) { Log::out("passthru - mknod - failed to chmod file"); return -FUSE_ENOENT; } } Log::out("passthru - mknod"); return 0; }
*/ include 'constants.php'; $mount = $working . $mount_point; $passthru = $working . $passthru_point; include 'log.class.php'; Log::initialize($logfile); include 'pool.class.php'; $dbConfig = array('server' => $host, 'username' => $user, 'password' => $password, 'database' => $database, 'port' => $port, 'prefix' => $prefix); $error = Pool::initialize($dbConfig); if ($error != "") { die($error); } include 'passthru.class.php'; /* Get the real path of the passthru directory */ $realpath = realpath($passthru); PassThru::initialize($passthrudirs, $realpath); include 'query.class.php'; /* Set the databse type */ Query::setDatabaseType($dbType); /* * Main FUSE functionality starts here */ $realmount = realpath($mount); echo "Mount point is : {$realmount}\n"; echo "Passthru is : {$realpath}\n"; if ($logfile != '') { $reallogfilepath = realpath($logfile); echo "Logfile is at : {$reallogfilepath}\n"; } echo "Starting MODXFS-PHP FUSE process\n"; include 'modxfs.class.php';
/** * List extended attributes of a file/directory * * @access public * * @param $path file path * @param $retval file name array of extended attributes */ function listxattr($path, &$retval) { Log::in("LISTXATTR {$path}"); /* Check for passthru */ if (PassThru::check($path)) { $ret = PassThru::listxattr($path, $retval); } else { $pi = Query::pathInfo($path); Query::fillContentId($pi, 0); $ret = Query::listxattr($pi, $retval); if ($ret == 0) { Query::resolveAttributes($retval); } } Log::out("LISTXATTR"); return $ret; }