function ArchiveTar::_close

10 calls to ArchiveTar::_close()
ArchiveTar::addString in drupal/core/lib/Drupal/Component/Archiver/ArchiveTar.php
This method add a single string as a file at the end of the existing archive. If the archive does not yet exists it is created.
ArchiveTar::createModify in drupal/core/lib/Drupal/Component/Archiver/ArchiveTar.php
This method creates the archive file and add the files / directories that are listed in $p_filelist. If the file already exists and is writable, it is replaced by the new tar. It is a create and not an add. If the file exists and is read-only or is a…
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
This method extract from the archive only the files indicated in the $p_filelist. These files are extracted in the current directory or in the directory indicated by the optional $p_path parameter. If indicated the $p_remove_path can be used in the…
ArchiveTar::extractModify in drupal/core/lib/Drupal/Component/Archiver/ArchiveTar.php
This method extract all the content of the archive in the directory indicated by $p_path. When relevant the memorized path of the files/dir can be modified by removing the $p_remove_path path at the beginning of the file/dir path. While extracting a…

... See full list

File

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

Class

ArchiveTar
Creates a (compressed) Tar archive

Namespace

Drupal\Component\Archiver

Code

function _close() {

  //if (isset($this->_file)) {
  if (is_resource($this->_file)) {
    if ($this->_compress_type == 'gz') {
      @gzclose($this->_file);
    }
    else {
      if ($this->_compress_type == 'bz2') {
        @bzclose($this->_file);
      }
      else {
        if ($this->_compress_type == 'none') {
          @fclose($this->_file);
        }
        else {
          $this
            ->_error('Unknown or missing compression type (' . $this->_compress_type . ')');
        }
      }
    }
    $this->_file = 0;
  }

  // ----- Look if a local copy need to be erase
  // Note that it might be interesting to keep the url for a time : ToDo
  if ($this->_temp_tarname != '') {
    @drupal_unlink($this->_temp_tarname);
    $this->_temp_tarname = '';
  }
  return true;
}