You are here

public function Archive_Tar::_close in Drupal 7

Return value

bool

10 calls to Archive_Tar::_close()
Archive_Tar::addString in modules/system/system.tar.inc
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.
Archive_Tar::createModify in modules/system/system.tar.inc
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…
Archive_Tar::extractInString in modules/system/system.tar.inc
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.
Archive_Tar::extractList in modules/system/system.tar.inc
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…
Archive_Tar::extractModify in modules/system/system.tar.inc
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

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

Class

Archive_Tar

Code

public 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 == 'lzma2') {
          @xzclose($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;
}