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?
If it works, then why not :)
The path/filename must be on Linux format?
Don't know...
Goba -- PHP Documentation Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
