guzba / zippy

Pure Nim implementation of deflate, zlib, gzip and zip.
MIT License
246 stars 29 forks source link

Added ability to extract zipfiles from stream in memory #10

Closed byt3bl33d3r closed 3 years ago

byt3bl33d3r commented 3 years ago

From #5, this allows you to extract zip files from an in-memory stream.

I also exposed the clear() method so that we can free up memory after it's extracted.

Example:

import os
import zippy/ziparchives
import streams

let ZIPFILE = slurp("archive.zip")

var archive = ZipArchive()
let zipStream = newStringStream(ZIPFILE)

archive.open(zipStream)
archive.extractAll(getCurrentDir() / "extractfolder")
archive.clear()
guzba commented 3 years ago

This looks great! Thanks for the PR. It is late here tonight yet but the changes look good so I plan to merge tomorrow.