A Zig library to work with zip files.
This is an experimental library and not meant for production use. The only place where this has been used is zigverm.
- Add
zip.zigto your dependencies
zig fetch --save https://github.com/AMythicDev/zip.zig/archive/refs/tags/v[VERSION].tar.gz- In your
build.zig:
pub fn build(b: *std.Build) !void {
// Get the dependency into your build.zig
const zip = b.dependency("zip", .{});
// Add import to all your compile targets
test_exe.root_module.addImport("zip", zip.module("zip")); const file = try std.fs.File.openFile("myzip.zip", .{});
const zipfile = try ZipArchive.openFromStreamSource(alloc, @constCast(&std.io.StreamSource{ .file = file }));
var m_iter = zipfile.members.iterator();
while (m_iter.next()) |i| {
std.debug.print("{s}", i.key_ptr.*);
}The project is licensed under Apache 2.0 License.