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

Breadcrumb

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

function Archive_Tar::_openWrite

Return value

bool

3 calls to Archive_Tar::_openWrite()
Archive_Tar::addString in vendor/pear/archive_tar/Archive/Tar.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.
Archive_Tar::createModify in vendor/pear/archive_tar/Archive/Tar.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…
Archive_Tar::_openAppend in vendor/pear/archive_tar/Archive/Tar.php

File

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

Class

Archive_Tar
Creates a (compressed) Tar archive

Code

public function _openWrite() {
    if ($this->_compress_type == 'gz' && function_exists('gzopen')) {
        $this->_file = @gzopen($this->_tarname, "wb9");
    }
    else {
        if ($this->_compress_type == 'bz2' && function_exists('bzopen')) {
            $this->_file = @bzopen($this->_tarname, "w");
        }
        else {
            if ($this->_compress_type == 'lzma2' && function_exists('xzopen')) {
                $this->_file = @xzopen($this->_tarname, 'w');
            }
            else {
                if ($this->_compress_type == 'none') {
                    $this->_file = @fopen($this->_tarname, "wb");
                }
                else {
                    $this->_error('Unknown or missing compression type (' . $this->_compress_type . ')');
                    return false;
                }
            }
        }
    }
    if ($this->_file == 0) {
        $this->_error('Unable to open in 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