function ArchiveTar::_jumpBlock

2 calls to ArchiveTar::_jumpBlock()
ArchiveTar::_extractInString in drupal/core/lib/Drupal/Component/Archiver/ArchiveTar.php
This method extract from the archive one file identified by $p_filename. The return value is a string with the file content, or NULL on error.
ArchiveTar::_extractList in drupal/core/lib/Drupal/Component/Archiver/ArchiveTar.php

File

drupal/core/lib/Drupal/Component/Archiver/ArchiveTar.php, line 863

Class

ArchiveTar
Creates a (compressed) Tar archive

Namespace

Drupal\Component\Archiver

Code

function _jumpBlock($p_len = null) {
  if (is_resource($this->_file)) {
    if ($p_len === null) {
      $p_len = 1;
    }
    if ($this->_compress_type == 'gz') {
      @gzseek($this->_file, gztell($this->_file) + $p_len * 512);
    }
    else {
      if ($this->_compress_type == 'bz2') {

        // ----- Replace missing bztell() and bzseek()
        for ($i = 0; $i < $p_len; $i++) {
          $this
            ->_readBlock();
        }
      }
      else {
        if ($this->_compress_type == 'none') {
          @fseek($this->_file, ftell($this->_file) + $p_len * 512);
        }
        else {
          $this
            ->_error('Unknown or missing compression type (' . $this->_compress_type . ')');
        }
      }
    }
  }
  return true;
}