Пример #1
0
 public function stat($cb, $pri = EIO_PRI_DEFAULT)
 {
     if (!FS::$supported) {
         call_user_func($cb, $this, FS::statPrepare(fstat($this->fd)));
         return;
     }
     if ($this->stat) {
         call_user_func($cb, $this, $this->stat);
     } else {
         eio_fstat($this->fd, $pri, function ($file, $stat) use($cb) {
             $stat = FS::statPrepare($stat);
             $file->stat = $stat;
             call_user_func($cb, $file, $stat);
         }, $this);
     }
 }
Пример #2
0
 public static function lstat($path, $cb, $pri = EIO_PRI_DEFAULT)
 {
     if (!self::$supported) {
         call_user_func($cb, $path, FS::statPrepare(lstat($path)));
         return;
     }
     return eio_lstat($path, $pri, function ($path, $stat) use($cb) {
         call_user_func($cb, $path, FS::statPrepare($stat));
     }, $path);
 }