Пример #1
0
 /**
  * Make a filesystem node
  *
  * @access public
  *
  * @param $path file path
  * @param $mode perma and type of the node
  * @param $dev device number
  */
 function mknod($path, $mode, $dev)
 {
     $isdir = false;
     $isfile = false;
     $islnk = false;
     Log::in("MKNOD");
     Log::output("Path {$path}");
     Log::output("Mode {$mode}");
     Log::output("Device {$dev}");
     /* Check for passthru */
     if (PassThru::check($path)) {
         $ret = PassThru::mknod($path, $mode);
         Log::out("MKNOD");
         return $ret;
     }
     if (($mode & FUSE_S_IFMT) == FUSE_S_IFLNK) {
         $islnk = true;
     }
     if ($islnk) {
         Log::out("MKNOD - Tried to create a sym link- failed");
         return -FUSE_ENOENT;
     }
     /* Otherwise must be a file or category, check first */
     Log::output("MKNOD - a file or a category");
     $pi = Query::pathInfo($path);
     if ($pi[PI_LEVEL] == PL_FILENAME || !$pi[PI_LEVEL] == PL_CATEGORY) {
         Log::output("MKNOD - calling query");
         $ret = Query::mknod($pi);
         Log::out("MKNOD");
         return $ret;
     } else {
         Log::out("MKNOD - not a file or category");
         return -FUSE_ENOENT;
     }
 }