You are here

public function ArchiveTar::_jumpBlock in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Archiver/ArchiveTar.php \Drupal\Core\Archiver\ArchiveTar::_jumpBlock()

Parameters

null $p_len:

Return value

bool

2 calls to ArchiveTar::_jumpBlock()
ArchiveTar::_extractInString in core/lib/Drupal/Core/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 core/lib/Drupal/Core/Archiver/ArchiveTar.php

File

core/lib/Drupal/Core/Archiver/ArchiveTar.php, line 1116

Class

ArchiveTar

Namespace

Drupal\Core\Archiver

Code

public 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 == 'lzma2') {

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