public function statvfs($cb, $pri = EIO_PRI_DEFAULT) { if (!FS::$supported) { call_user_func($cb, $this, false); return; } if ($this->statvfs) { call_user_func($cb, $this, $this->statvfs); } else { eio_fstatvfs($this->fd, $pri, function ($file, $stat) use($cb) { $file->statvfs = $stat; call_user_func($cb, $file, $stat); }, $this); } }
/** * Statvfs() * @param callable $cb Callback * @param integer $pri Priority * @return resource|boolean */ public function statvfs($cb, $pri = EIO_PRI_DEFAULT) { $cb = CallbackWrapper::forceWrap($cb); if (!$this->fd) { if ($cb) { $cb($this, false); } return false; } if (!FileSystem::$supported) { if ($cb) { $cb($this, false); } return false; } if ($this->statvfs) { $cb($this, $this->statvfs); return true; } return eio_fstatvfs($this->fd, $pri, function ($file, $stat) use($cb) { $file->statvfs = $stat; $cb($file, $stat); }, $this); }