Skip to content

AMythicDev/zip.zig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zip.zig

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.

Adding it to your project

  • Add zip.zig to 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"));

Basic Usage

Open a zip file and list its members

    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.*);
    }

License

The project is licensed under Apache 2.0 License.

About

Library for handling zip files in Zig

Resources

License

Stars

1 star

Watchers

1 watching

Forks

Packages

 
 
 

Contributors

Languages