function Archive_Tar::extractList

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 same way as it is used in extractModify() method.

Parameters

array $p_filelist An array of filenames and directory names,: or a single string with names separated by a single blank space.

string $p_path The path of the directory where the: files/dir need to by extracted.

string $p_remove_path Part of the memorized path that can be: removed if present at the beginning of the file/dir path.

boolean $p_preserve Preserve user/group ownership of files:

boolean $p_symlinks Allow symlinks.:

Return value

true on success, false on error.

See also

extractModify()

File

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

Class

Archive_Tar

Code

public function extractList($p_filelist, $p_path = '', $p_remove_path = '', $p_preserve = false, $p_symlinks = true) {
    $v_result = true;
    $v_list_detail = array();
    if (is_array($p_filelist)) {
        $v_list = $p_filelist;
    }
    elseif (is_string($p_filelist)) {
        $v_list = explode($this->_separator, $p_filelist);
    }
    else {
        $this->_error('Invalid string list');
        return false;
    }
    if ($v_result = $this->_openRead()) {
        $v_result = $this->_extractList($p_path, $v_list_detail, "partial", $v_list, $p_remove_path, $p_preserve, $p_symlinks);
        $this->_close();
    }
    return $v_result;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.