Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Tar.php

function Archive_Tar::_openReadWrite

Return value

bool

1 call to Archive_Tar::_openReadWrite()
Archive_Tar::_openAppend in vendor/pear/archive_tar/Archive/Tar.php

File

vendor/pear/archive_tar/Archive/Tar.php, line 880

Class

Archive_Tar
Creates a (compressed) Tar archive

Code

public function _openReadWrite() {
    if ($this->_compress_type == 'gz') {
        $this->_file = @gzopen($this->_tarname, "r+b");
    }
    else {
        if ($this->_compress_type == 'bz2') {
            $this->_error('Unable to open bz2 in read/write mode \'' . $this->_tarname . '\' (limitation of bz2 extension)');
            return false;
        }
        else {
            if ($this->_compress_type == 'lzma2') {
                $this->_error('Unable to open lzma2 in read/write mode \'' . $this->_tarname . '\' (limitation of lzma2 extension)');
                return false;
            }
            else {
                if ($this->_compress_type == 'none') {
                    $this->_file = @fopen($this->_tarname, "r+b");
                }
                else {
                    $this->_error('Unknown or missing compression type (' . $this->_compress_type . ')');
                    return false;
                }
            }
        }
    }
    if ($this->_file == 0) {
        $this->_error('Unable to open in read/write mode \'' . $this->_tarname . '\'');
        return false;
    }
    return true;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal