SteezCram / sevenzip

7z native wrapper for NodeJS
MIT License
7 stars 0 forks source link

error windows #3

Open am-abandoned opened 2 years ago

am-abandoned commented 2 years ago

Z:\ahsan\node_modules\@steezcram\sevenzip\index.js:222 progress: parseInt(dataArr[dataArr.length - 4].slice(0, -1), 10), ^

TypeError: Cannot read properties of undefined (reading 'slice') at parseProgress (Z:\ahsan\node_modules\@steezcram\sevenzip\index.js:222:56) at Socket. (Z:\ahsan\node_modules\@steezcram\sevenzip\index.js:127:3 4) at Socket.emit (node:events:539:35) at addChunk (node:internal/streams/readable:324:12) at readableAddChunk (node:internal/streams/readable:293:11) at Socket.Readable.push (node:internal/streams/readable:234:10) at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)

Node.js v17.9.0

SteezCram commented 2 years ago

Hello, could you provide more details about what you are doing? I have tested it and it works perfectly on my side.

I have pushed a new release v1.1.5 of the module. Can you tell me if it fixes it?

am-abandoned commented 2 years ago

hi. sorry for late answer. That error was solved. however, I see there is no way to identify if extraction is finished or not. i tried to use a 1GB file and the progress percentage reached max 98%. evan though extraction was done 100%. if it would have shown 100% progress I could have utilized it as finished but I doubt that for another big file it might stop at 98%. it will be random I guess.

Can u add an onEnd/onfinished event or let the progress report keep coming until it reaches 100%?

image
SteezCram commented 2 years ago

Yes, I have made a few tests and by the async nature of NodeJS, it is not precise. For short operations, it can be unreliable.

About your request, I added a call to the progressCallback when the operation is finished, so it currently reports progress: 100 but with no file processed.

I will push the update soon.

am-abandoned commented 2 years ago

Cool. I will be waiting for that callback

SteezCram commented 2 years ago

I have published the new version.