1.20.x system.tar.inc public Archive_Tar::_readBlock()

Return value

null|string:

File

modules/system/system.tar.inc, line 1105

Class

Archive_Tar

Code

public function _readBlock() 
 {
  $v_block = null;
  if (is_resource($this->_file)) {
    if ($this->_compress_type == 'gz') {
      $v_block = @gzread($this->_file, 512);
    }
    else {
      if ($this->_compress_type == 'bz2') {
        $v_block = @bzread($this->_file, 512);
      }
      else {
        if ($this->_compress_type == 'lzma2') {
          $v_block = @xzread($this->_file, 512);
        }
        else {
          if ($this->_compress_type == 'none') {
            $v_block = @fread($this->_file, 512);
          }
          else {
            $this->_error(
            'Unknown or missing compression type ('
              . $this->_compress_type . ')'
              );
          }
        }
      }
    }
  }
  return $v_block;
}