Exemple #1
0
 /**
  * Datasync()
  * @param  callable $cb Callback
  * @param  integer $pri Priority
  * @return resource|false
  */
 public function datasync($cb, $pri = EIO_PRI_DEFAULT)
 {
     $cb = CallbackWrapper::forceWrap($cb);
     if (!$this->fd) {
         if ($cb) {
             $cb($this, false);
         }
         return false;
     }
     if (!FileSystem::$supported) {
         $cb($this, true);
         return false;
     }
     return eio_fdatasync($this->fd, $pri, $cb, $this);
 }
Exemple #2
0
 public function datasync($cb, $pri = EIO_PRI_DEFAULT)
 {
     if (!FS::$supported) {
         call_user_func($cb, $this, true);
         return;
     }
     return eio_fdatasync($this->fd, $pri, $cb, $this);
 }