code: public function stream_truncate($size)
      {
          if (!$this->handle) {
              return false;
          }
          self::restorePrev();
          $success = \ftruncate($this->handle, $size);
          self::register();
          return $success;
      }
docs: Truncates a file to the given size
  
  @param integer $size Truncate to this size
  
  @return boolean
  
  @see http://php.net/manual/en/streamwrapper.stream-truncate.php