wellawaretech/node-zipstream — Issue #5: Exception 
Author: gitfy
Created: 2012-02-27 05:09:29+00:00
State: open

Hi
I am trying to zip a set of files different folders and i get this exception

Caught exception: AssertionError: trying to write beyond buffer length
at writeUInt32 (buffer.js:890:12)
at Buffer.writeUInt32LE (buffer.js:910:3)
at ZipStream._pushCentralDirectory (/node_modules/zipstream/zipstream.js:206:9)


when the number of files i add exceeds more than 5 or something.
I couldn't exactly tell when this happens :

tmp/4f4b0e656856c5567a000182/configdata/core.auth.policies.json
tmp/4f4b0e656856c5567a000182/configdata/core.auth.policysets.json
tmp/4f4b0e656856c5567a000182/configdata/core.contacts.json
tmp/4f4b0e656856c5567a000182/configdata/core.memberships.json
tmp/4f4b0e656856c5567a000182/configdata/core.rules.json
tmp/4f4b0e656856c5567a000182/configdata/core.teams.json
tmp/4f4b0e656856c5567a000182/configdata/core.tenant.configs.json

tmp/4f4b0e656856c5567a000182/techdata/core.auth.actions.json
tmp/4f4b0e656856c5567a000182/techdata/core.extension.attributes.json
tmp/4f4b0e656856c5567a000182/techdata/core.lookup.configs.json
tmp/4f4b0e656856c5567a000182/techdata/core.lookups.json
tmp/4f4b0e656856c5567a000182/techdata/core.metadata.collections.json
[tmp/4f4b0e656856c5567a000182/techdata/core.metadata.models.json
tmp/4f4b0e656856c5567a000182/techdata/core.metadata.scripts.json
tmp/4f4b0e656856c5567a000182/techdata/core.metadata.ui.profiles.json
tmp/4f4b0e656856c5567a000182/techdata/core.relationship.types.json

When i do the two sets separately, they work fine. when i combine, i get the exception. Also if try to add the directory structure, i get another exception :

Caught exception: AssertionError: trying to write beyond buffer length
at writeUInt16 (buffer.js:856:12)
at Buffer.writeUInt16LE (buffer.js:872:3)
at ZipStream._pushCentralDirectory (/node_modules/zipstream/zipstream.js:208:9).

There are other times, i got exception at line 230 also. Don't know exactly what is going on.
Any help on what i might be doing wrong ?

Thanks.