Archive_Tar::create() -- create archive file Описание
This method creates the archive file and adds the listed files or
directories.
If a file with the same tar name exists and is writable, it is replaced
by the new tar archive (it is not an 'add', but a 'create').
If a file exists and is write-protected or is a folder,
the method raises a PEAR_Error.
Параметр
mixed $filelist -
an array of filenames and directory names, or a single
string with names separated by a single blank space.
For each directory added in the archive, the files and
sub-directories are also added.
Возвращаемое значение
boolean - Возвращает TRUE в случае успеха и FALSE при неудаче.
ЗаметкаЭта функция не должна вызываться статически. ПримерПример 26-1. Creating an archive
<?php
$tar_object = new Archive_Tar("myArchive.tar");
// print errors
$tar_object->setErrorHandling(PEAR_ERROR_PRINT);
// Archive content
$v_list[0]="file.txt";
// the slash is optional
$v_list[1]="data/";
$v_list[2]="file.log";
// create the archive
$tar_object->create($v_list);
?>
|
|
|