Archive_Tar::addModify()

Archive_Tar::addModify()

Archive_Tar::addModify() -- add files or directories

Description

This methods add files and directories listed in filelist at the end of the existing archive.

If the archive does not exists it attempts to create it. If a file or directory is already in the archive it will only be added at the end of the archive. There is no update of the existing archived file or directory. However while extracting the archive, the last file will replace the first one. This results in a none optimization of the archive size. If a file or directory does not exists, it is ignored.

Parameter

  • mixed $filelist - an array of filenames and directory names, or a single string with names separated by a single blank space.

  • string $add_dir - a string which contains a path to be added to the memorized path of each element in the list.

  • string $remove_dir - a string which contains a path to be removed from the memorized path of each element in the list, when relevant.

    The path indicated in add_dir will be added at the beginning of the memorized path of each file/directory listed. However it can be set to empty ''. The adding of a path is done after the removing of path. The path add/remove ability enables the user to prepare an archive for extraction in a different path than the original path.

Return value

boolean - Returns TRUE on success, FALSE on failure.

Note

This function can not be called statically.

Example

On Windows system, Windows path format can be used. However if the files are using a Windows path, the $remove_dir parameter must also be in Windows path format. The $add_dir parameter can be in Windows or Unix path format.

© Copyright 2003-2023 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.