using the Archive_Tar
| From: | Romain Valette | Date: | Tue, 28 Oct 2003 10:28:39 +0000 |
| Subject: | using the Archive_Tar | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-8642@lists.php.net to get a copy of this message | ||
Hello,
I want to use PEAR to use the tar command in the Archive_tar.
So I have a file in /path/essaitar.php
<?php
// include class
require("Tar.php");
// create Archive_Tar() object
// specify filename for output file
$tar = new Archive_Tar("data.tar");
// set up file list
$files = array("/var/www/index.html","/var/www/pear.conf");
// build archive
$tar->create($files) or die("Don't work");
?>
And the browser when i launch the php file say: Don't work
I don't understand because the index.html exist and the pear.conf also
exist.
Another question: The php file is in the directory /path. So it will
create the data.tar in the /path and if i want to create relative path,
i start in the directoty path?
for example, in the directoty path/, I have two files: toto.html and
titi.html
I want to create an archive of these two files:
so I can use : $files = array("toto.html","titi.html"); or I have to use
absolute path: $files = array("/path/toto.html","/path/titi.html"); ?
Please help me...
and sorry for my bad english ;-)
Romain Valette