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

Return value

bool:

File

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

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 != '') {
    @backdrop_unlink($this->_temp_tarname);
    $this->_temp_tarname = '';
  }

  return true;
}