public function Archive_Tar::extractList
public Archive_Tar::extractList($p_filelist, $p_path = '', $p_remove_path = '', $p_preserve = false)
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:
Return value
true on success, false on error.
See also
extractModify()
File
- modules/system/system.tar.inc, line 671
Class
Code
public function extractList($p_filelist, $p_path = '', $p_remove_path = '', $p_preserve = false) { $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 ); $this->_close(); } return $v_result; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!system!system.tar.inc/function/Archive_Tar::extractList/7.x