Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.6.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] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2007-01-23 02:23 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!