Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.5.0

Bug #9921 compression with bzip2 fails
Submitted: 2007-01-22 23:31 UTC
From: martin at proctophantasmist dot cjb dot net Assigned: cellog
Status: Closed Package: Archive_Tar (version CVS)
PHP Version: 5.2.0 OS: Windows
Roadmaps: (Not assigned)    
Subscription  


 [2007-01-22 23:31 UTC] martin at proctophantasmist dot cjb dot net (M. Sarrazac)
Description: ------------ there is a problem with the calls to bzopen: when creating an Archive_File object with bz2 compression and calling createModify for instance, the call will fail with this error: Warning: bzopen() [function.bzopen]: 'wb' is not a valid mode for bzopen(). Only 'w' and 'r' are supported. in [some path}\Tar.php on line 602 Unable to open in write mode '[some file]' suggested patch: Index: Archive_Tar/Archive/Tar.php =================================================================== @@ -599,7 +599,7 @@ if ($this->_compress_type == 'gz') $this->_file = @gzopen($this->_tarname, "wb9"); else if ($this->_compress_type == 'bz2') - $this->_file = @bzopen($this->_tarname, "wb"); + $this->_file = @bzopen($this->_tarname, "w"); else if ($this->_compress_type == 'none') $this->_file = @fopen($this->_tarname, "wb"); else works for me.

Comments

 [2007-01-22 23:41 UTC] martin at proctophantasmist dot cjb dot net
By the way, I don't know if the bug is dependant on the version of php. And I haven't checked the behaviour of bzopen without the "b" with regards to \n ; but I assume it's faithfull to the binary representation of the file originally encoded, I don't see how the "smart" textual behaviour could be preserved through the compression anyway... Though that might be because it is very late here and I am extremely tired.
 [2007-01-23 00:50 UTC] cellog (Greg Beaver)
sure enough, it's in the source, which has not been modified for 2 years or more
 [2007-01-23 02:23 UTC] cellog (Greg Beaver)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.