Re: New example for bzip2

From: Date: Mon, 10 Feb 2003 22:23:26 +0000
Subject: Re: New example for bzip2
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969351710@lists.php.net to get a copy of this message
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

« previous php.doc (#969351710) next »