PHPDaemon\FS\File::statvfs PHP Method

statvfs() public method

Statvfs()
public statvfs ( callable $cb, integer $pri = EIO_PRI_DEFAULT ) : resource | boolean
$cb callable Callback
$pri integer 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);
    }