Zip utilities for V
wzip is a more readable version of the szip in V.
Installation
v install --git https://github.com/wioenena-q/wzip
Usage looks like this
import szip
import wzip
fn main() {
mut zip := szip.open("output.zip", .best_compression, .write)!
defer { zip.close() }
mut wzip_directory := &wzip.WZipDir {
path: "my_directory",
files: [
&wzip.WZipFile {
path: "hello.txt",
bytes: "Hello".bytes()
}
]
}
wzip_directory.add_file(&wzip.WZipFile {
path: "world.txt",
bytes: "World!".bytes()
})
wzip_directory.create(mut zip)!
}