I make a exemple for bzip2, it takes a file compressed and decompress
it, like bzip2 -d does.
Here the code:
<?php
$filebz = "c:\\file.tar.bz2"; //your bzip2 file
$filename = 'c:\\file.tar'; //name to save your file
$bz = bzopen($arquivo, "r");
if (!$fp = fopen($filename, 'wb')) {
print "Error opening file ($filename)";
exit;
}
while($t=bzread($bz)) {
if (!fwrite($fp,$t)) {
print "Error writing to file ($filename)";
exit;
}
}
bzclose($bz);
fclose($fp);
?>
Can I add this example to documentation on bzip2?
The path/filename must be on Linux format?
Thanks
Fernando Correa da Conceição
--
PHP Documentation Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
- Re: [PHP-DOC] New example for bzip2 Fernando Correa Da Conceição
- Re: [PHP-DOC] New example for bzip2 Gabor Hojtsy