HTML Logo by World Wide Web Consortium ( Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS. ocPortal 9 is superseded by Composr 10.

Head over to for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.

Problem between the Mac 'Archive Utility' and Zend zip code

Problem between the Mac 'Archive Utility' and Zend zip code This is a very technical blog post for programmers, and nothing to do with ocPortal. Hopefully people experiencing the same problem I did will find this when they search.

The Mac produces an error:
Unable to unarchive "" into "xxx".
(Error 1 - Operation not permitted.)
when unzipping any file archived via the zip file class originally posted as a Zend tutorial.

If you look in the Mac console you'll see an error:
ditto: Couldn't read pkzip signature.

It'd be nice if the UI gave that error rather than "Operation not permitted", but I digress.

The problem is apparently the fault of the example code the Zend consultant gave, as it's not meeting the ZIP file specification properly and Apple's app can't cope (just about any other unzip app will work though, including on the command line). The Zend code has these lines (I'm talking about the set immediately after $fr .= $zdata;):


$fr .= pack("V",$crc);
$fr .= pack("V",$c_len);
$fr .= pack("V",$unc_len);
which are to output the so called "Data descriptor". However, the 3rd bit of the 'General purpose bit flag' was not set in the code so Apple got confused when it met the extraneous data descriptor.

To solve the problem just strip the 3 lines I identified.

I'm going to point the article author to this blog post. I think my interpretation of the spec is correctly in Apple's favour, and the fix certainly works. At first I thought it was Apple's fault but I then realised the General purpose bit flag was actually blank and thus not indicating the existence of the Data descriptor section.

View all


There have been no trackbacks yet