{"id":13731497,"url":"https://github.com/kuba--/zip","last_synced_at":"2026-03-14T12:53:34.743Z","repository":{"id":29229186,"uuid":"32760969","full_name":"kuba--/zip","owner":"kuba--","description":"A portable, simple zip library written in C","archived":false,"fork":false,"pushed_at":"2025-02-06T13:14:49.000Z","size":609,"stargazers_count":1480,"open_issues_count":4,"forks_count":289,"subscribers_count":40,"default_branch":"master","last_synced_at":"2025-04-12T20:43:26.296Z","etag":null,"topics":["c","compression","hacking","miniz","portable","zip"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kuba--.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-03-23T21:52:40.000Z","updated_at":"2025-04-12T11:08:18.000Z","dependencies_parsed_at":"2024-03-28T13:27:33.244Z","dependency_job_id":"0b8dffc6-80c0-463c-b0c2-bd02e5d0885c","html_url":"https://github.com/kuba--/zip","commit_stats":{"total_commits":311,"total_committers":54,"mean_commits":"5.7592592592592595","dds":0.3215434083601286,"last_synced_commit":"27034d35b58e4eb7899925576327a8845a98d9b7"},"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kuba--%2Fzip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kuba--%2Fzip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kuba--%2Fzip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kuba--%2Fzip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kuba--","download_url":"https://codeload.github.com/kuba--/zip/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254110374,"owners_count":22016391,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","compression","hacking","miniz","portable","zip"],"created_at":"2024-08-03T02:01:31.412Z","updated_at":"2026-03-14T12:53:34.733Z","avatar_url":"https://github.com/kuba--.png","language":"C","readme":"## A portable (OSX/Linux/Windows/Android/iOS), simple zip library written in C\n\nThis is done by hacking awesome [miniz](https://github.com/richgel999/miniz) library and layering functions on top of the miniz v3.1.1 API.\n\n[![Build](https://github.com/kuba--/zip/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/kuba--/zip/actions/workflows/build.yml)\n\n### The Idea\n\n\u003cimg src=\"zip.png\" name=\"zip\" /\u003e\n... Some day, I was looking for zip library written in C for my project, but I could not find anything simple enough and lightweight.\nEverything what I tried required 'crazy mental gymnastics' to integrate or had some limitations or was too heavy.\nI hate frameworks, factories and adding new dependencies. If I must to install all those dependencies and link new library, I'm getting almost sick.\nI wanted something powerful and small enough, so I could add just a few files and compile them into my project.\nAnd finally I found miniz.\nMiniz is a lossless, high performance data compression library in a single source file. I only needed simple interface to append buffers or files to the current zip-entry. Thanks to this feature I'm able to merge many files/buffers and compress them on-the-fly.\n\nIt was the reason, why I decided to write zip module on top of the miniz. It required a little bit hacking and wrapping some functions, but I kept simplicity. So, you can grab these 3 files and compile them into your project. I hope that interface is also extremely simple, so you will not have any problems to understand it.\n\n### Examples\n\n* Create a new zip archive with default compression level.\n\n```c\nstruct zip_t *zip = zip_open(\"foo.zip\", ZIP_DEFAULT_COMPRESSION_LEVEL, 'w');\n{\n    zip_entry_open(zip, \"foo-1.txt\");\n    {\n        const char *buf = \"Some data here...\\0\";\n        zip_entry_write(zip, buf, strlen(buf));\n    }\n    zip_entry_close(zip);\n\n    zip_entry_open(zip, \"foo-2.txt\");\n    {\n        // merge 3 files into one entry and compress them on-the-fly.\n        zip_entry_fwrite(zip, \"foo-2.1.txt\");\n        zip_entry_fwrite(zip, \"foo-2.2.txt\");\n        zip_entry_fwrite(zip, \"foo-2.3.txt\");\n    }\n    zip_entry_close(zip);\n}\nzip_close(zip);\n```\n\n* Append to the existing zip archive.\n\n```c\nstruct zip_t *zip = zip_open(\"foo.zip\", ZIP_DEFAULT_COMPRESSION_LEVEL, 'a');\n{\n    zip_entry_open(zip, \"foo-3.txt\");\n    {\n        const char *buf = \"Append some data here...\\0\";\n        zip_entry_write(zip, buf, strlen(buf));\n    }\n    zip_entry_close(zip);\n}\nzip_close(zip);\n```\n\n* Extract a zip archive into a folder.\n\n```c\nint on_extract_entry(const char *filename, void *arg) {\n    static int i = 0;\n    int n = *(int *)arg;\n    printf(\"Extracted: %s (%d of %d)\\n\", filename, ++i, n);\n\n    return 0;\n}\n\n// From \"foo.zip\" on disk\nint arg = 2;\nzip_extract(\"foo.zip\", \"/tmp\", on_extract_entry, \u0026arg);\n\n// Or from memory\narg = 2;\nzip_stream_extract(zipstream, zipstreamsize, \"/tmp\", on_extract_entry, \u0026arg);\n```\n\n* Extract a zip entry into memory.\n\n```c\nvoid *buf = NULL;\nsize_t bufsize;\n\nstruct zip_t *zip = zip_open(\"foo.zip\", 0, 'r');\n{\n    zip_entry_open(zip, \"foo-1.txt\");\n    {\n        zip_entry_read(zip, \u0026buf, \u0026bufsize);\n    }\n    zip_entry_close(zip);\n}\nzip_close(zip);\n\nfree(buf);\n```\n\n* Extract a zip entry into memory (no internal allocation).\n\n```c\nunsigned char *buf;\nsize_t bufsize;\n\nstruct zip_t *zip = zip_open(\"foo.zip\", 0, 'r');\n{\n    zip_entry_open(zip, \"foo-1.txt\");\n    {\n        bufsize = zip_entry_size(zip);\n        buf = calloc(sizeof(unsigned char), bufsize);\n\n        zip_entry_noallocread(zip, (void *)buf, bufsize);\n    }\n    zip_entry_close(zip);\n}\nzip_close(zip);\n\nfree(buf);\n```\n\n* Extract a zip entry into memory using callback.\n\n```c\nstruct buffer_t {\n    char *data;\n    size_t size;\n};\n\nstatic size_t on_extract(void *arg, unsigned long long offset, const void *data, size_t size) {\n    struct buffer_t *buf = (struct buffer_t *)arg;\n    buf-\u003edata = realloc(buf-\u003edata, buf-\u003esize + size + 1);\n    assert(NULL != buf-\u003edata);\n\n    memcpy(\u0026(buf-\u003edata[buf-\u003esize]), data, size);\n    buf-\u003esize += size;\n    buf-\u003edata[buf-\u003esize] = 0;\n\n    return size;\n}\n\nstruct buffer_t buf = {0};\nstruct zip_t *zip = zip_open(\"foo.zip\", 0, 'r');\n{\n    zip_entry_open(zip, \"foo-1.txt\");\n    {\n        zip_entry_extract(zip, on_extract, \u0026buf);\n    }\n    zip_entry_close(zip);\n}\nzip_close(zip);\n\nfree(buf.data);\n```\n\n* Extract a zip entry into a file.\n\n```c\nstruct zip_t *zip = zip_open(\"foo.zip\", 0, 'r');\n{\n    zip_entry_open(zip, \"foo-2.txt\");\n    {\n        zip_entry_fread(zip, \"foo-2.txt\");\n    }\n    zip_entry_close(zip);\n}\nzip_close(zip);\n```\n\n* Create a new zip archive in memory (stream API).\n\n```c\nchar *outbuf = NULL;\nsize_t outbufsize = 0;\n\nconst char *inbuf = \"Append some data here...\\0\";\nstruct zip_t *zip = zip_stream_open(NULL, 0, ZIP_DEFAULT_COMPRESSION_LEVEL, 'w');\n{\n    zip_entry_open(zip, \"foo-1.txt\");\n    {\n        zip_entry_write(zip, inbuf, strlen(inbuf));\n    }\n    zip_entry_close(zip);\n\n    /* copy compressed stream into outbuf */\n    zip_stream_copy(zip, (void **)\u0026outbuf, \u0026outbufsize);\n}\nzip_stream_close(zip);\n\nfree(outbuf);\n```\n\n* Extract a zip entry into a memory (stream API).\n\n```c\nchar *buf = NULL;\nsize_t bufsize = 0;\n\nstruct zip_t *zip = zip_stream_open(zipstream, zipstreamsize, 0, 'r');\n{\n    zip_entry_open(zip, \"foo-1.txt\");\n    {\n        zip_entry_read(zip, (void **)\u0026buf, \u0026bufsize);\n    }\n    zip_entry_close(zip);\n}\nzip_stream_close(zip);\n\nfree(buf);\n```\n\n* Extract a partial zip entry\n\n```c\nunsigned char buf[16];\nsize_t bufsize = sizeof(buf);\n\nstruct zip_t *zip = zip_open(\"foo.zip\", 0, 'r');\n{\n    zip_entry_open(zip, \"foo-1.txt\");\n    {\n        size_t offset = 4;\n        ssize_t nread = zip_entry_noallocreadwithoffset(zip, offset, bufsize, (void *)buf);\n    }\n\n    zip_entry_close(zip);\n}\nzip_close(zip);\n\nfree(buf);\n```\n\n* List of all zip entries\n\n```c\nstruct zip_t *zip = zip_open(\"foo.zip\", 0, 'r');\nint i, n = zip_entries_total(zip);\nfor (i = 0; i \u003c n; ++i) {\n    zip_entry_openbyindex(zip, i);\n    {\n        const char *name = zip_entry_name(zip);\n        int isdir = zip_entry_isdir(zip);\n        unsigned long long size = zip_entry_size(zip);\n        unsigned int crc32 = zip_entry_crc32(zip);\n    }\n    zip_entry_close(zip);\n}\nzip_close(zip);\n```\n\n* Compress folder (recursively)\n\n```c\nvoid zip_walk(struct zip_t *zip, const char *path) {\n    DIR *dir;\n    struct dirent *entry;\n    char fullpath[MAX_PATH];\n    struct stat s;\n\n    memset(fullpath, 0, MAX_PATH);\n    dir = opendir(path);\n    assert(dir);\n\n    while ((entry = readdir(dir))) {\n      // skip \".\" and \"..\"\n      if (!strcmp(entry-\u003ed_name, \".\\0\") || !strcmp(entry-\u003ed_name, \"..\\0\"))\n        continue;\n\n      snprintf(fullpath, sizeof(fullpath), \"%s/%s\", path, entry-\u003ed_name);\n      stat(fullpath, \u0026s);\n      if (S_ISDIR(s.st_mode))\n        zip_walk(zip, fullpath);\n      else {\n        zip_entry_open(zip, fullpath);\n        zip_entry_fwrite(zip, fullpath);\n        zip_entry_close(zip);\n      }\n    }\n\n    closedir(dir);\n}\n```\n\n* Delete zip archive entries.\n\n```c\nchar *entries[] = {\"unused.txt\", \"remove.ini\", \"delete.me\"};\n// size_t indices[] = {0, 1, 2};\n\nstruct zip_t *zip = zip_open(\"foo.zip\", 0, 'd');\n{\n    zip_entries_delete(zip, entries, 3);\n\n    // you can also delete by index, instead of by name\n    // zip_entries_deletebyindex(zip, indices, 3);\n}\nzip_close(zip);\n```\n\n### Bindings\n\nCompile zip library as a dynamic library.\n\n```shell\n$ mkdir build\n$ cd build\n$ cmake -DBUILD_SHARED_LIBS=true ..\n$ cmake --build .\n```\n\n#### [Go](https://golang.org) (cgo)\n\u003e Third party binding: [kuba--/c-go-zip](https://github.com/kuba--/c-go-zip)\n\n```go\npackage main\n\n/*\n#cgo CFLAGS: -I../src\n#cgo LDFLAGS: -L. -lzip\n#include \u003czip.h\u003e\n*/\nimport \"C\"\nimport \"unsafe\"\n\nfunc main() {\n    path := C.CString(\"/tmp/go.zip\")\n    zip := C.zip_open(path, 6, 'w')\n\n    entryname := C.CString(\"test\")\n    C.zip_entry_open(zip, entryname)\n\n    content := \"test content\"\n    buf := unsafe.Pointer(C.CString(content))\n    bufsize := C.size_t(len(content))\n    C.zip_entry_write(zip, buf, bufsize)\n\n    C.zip_entry_close(zip)\n\n    C.zip_close(zip)\n}\n```\n\n#### [Rust](https://www.rust-lang.org) (ffi)\n\n```rust\nextern crate libc;\nuse std::ffi::CString;\n\n#[repr(C)]\npub struct Zip {\n    _private: [u8; 0],\n}\n\n#[link(name = \"zip\")]\nextern \"C\" {\n    fn zip_open(path: *const libc::c_char, level: libc::c_int, mode: libc::c_char) -\u003e *mut Zip;\n    fn zip_close(zip: *mut Zip) -\u003e libc::c_void;\n\n    fn zip_entry_open(zip: *mut Zip, entryname: *const libc::c_char) -\u003e libc::c_int;\n    fn zip_entry_close(zip: *mut Zip) -\u003e libc::c_int;\n    fn zip_entry_write(\n        zip: *mut Zip,\n        buf: *const libc::c_void,\n        bufsize: libc::size_t,\n    ) -\u003e libc::c_int;\n}\n\nfn main() {\n    let path = CString::new(\"/tmp/rust.zip\").unwrap();\n    let mode: libc::c_char = 'w' as libc::c_char;\n\n    let entryname = CString::new(\"test.txt\").unwrap();\n    let content = \"test content\\0\";\n\n    unsafe {\n        let zip: *mut Zip = zip_open(path.as_ptr(), 5, mode);\n        {\n            zip_entry_open(zip, entryname.as_ptr());\n            {\n                let buf = content.as_ptr() as *const libc::c_void;\n                let bufsize = content.len() as libc::size_t;\n                zip_entry_write(zip, buf, bufsize);\n            }\n            zip_entry_close(zip);\n        }\n        zip_close(zip);\n    }\n}\n```\n\n#### [Ruby](http://www.ruby-lang.org) (ffi)\n\nInstall _ffi_ gem.\n\n```shell\n$ gem install ffi\n```\n\nBind in your module.\n\n```ruby\nrequire 'ffi'\n\nmodule Zip\n  extend FFI::Library\n  ffi_lib \"./libzip.#{::FFI::Platform::LIBSUFFIX}\"\n\n  attach_function :zip_open, [:string, :int, :char], :pointer\n  attach_function :zip_close, [:pointer], :void\n\n  attach_function :zip_entry_open, [:pointer, :string], :int\n  attach_function :zip_entry_close, [:pointer], :void\n  attach_function :zip_entry_write, [:pointer, :string, :int], :int\nend\n\nptr = Zip.zip_open(\"/tmp/ruby.zip\", 6, \"w\" )\n\nstatus = Zip.zip_entry_open(ptr, \"test\")\n\ncontent = \"test content\"\nstatus = Zip.zip_entry_write(ptr, content, content.size())\n\nZip.zip_entry_close(ptr)\nZip.zip_close(ptr)\n```\n\n#### [Python](https://www.python.org) (cffi)\n\nInstall _cffi_ package\n\n```shell\n$ pip install cffi\n```\n\nBind in your package.\n\n```python\nimport ctypes.util\nfrom cffi import FFI\n\nffi = FFI()\nffi.cdef(\"\"\"\n    struct zip_t *zip_open(const char *zipname, int level, char mode);\n    void zip_close(struct zip_t *zip);\n\n    int zip_entry_open(struct zip_t *zip, const char *entryname);\n    int zip_entry_close(struct zip_t *zip);\n    int zip_entry_write(struct zip_t *zip, const void *buf, size_t bufsize);\n\"\"\"\n)\n\nZip = ffi.dlopen(ctypes.util.find_library(\"zip\"))\n\nptr = Zip.zip_open(\"/tmp/python.zip\", 6, 'w')\n\nstatus = Zip.zip_entry_open(ptr, \"test\")\n\ncontent = \"test content\"\nstatus = Zip.zip_entry_write(ptr, content, len(content))\n\nZip.zip_entry_close(ptr)\nZip.zip_close(ptr)\n```\n\n#### [Never](https://never-lang.readthedocs.io/) (ffi)\n\n```never\nextern \"libzip.so\" func zip_open(zipname: string, level: int, mode: char) -\u003e c_ptr\nextern \"libzip.so\" func zip_close(zip: c_ptr) -\u003e void\n\nextern \"libzip.so\" func zip_entry_open(zip: c_ptr, entryname: string) -\u003e int\nextern \"libzip.so\" func zip_entry_close(zip: c_ptr) -\u003e int\nextern \"libzip.so\" func zip_entry_write(zip: c_ptr, buf: string, bufsize: int) -\u003e int\nextern \"libzip.so\" func zip_entry_fwrite(zip: c_ptr, filename: string) -\u003e int\n\nfunc main() -\u003e int\n{\n    let content = \"Test content\"\n\n    let zip = zip_open(\"/tmp/never.zip\", 6, 'w');\n\n    zip_entry_open(zip, \"test.file\");\n    zip_entry_fwrite(zip, \"/tmp/test.txt\");\n    zip_entry_close(zip);\n\n    zip_entry_open(zip, \"test.content\");\n    zip_entry_write(zip, content, length(content));\n    zip_entry_close(zip);\n\n    zip_close(zip);\n    0\n}\n```\n\n#### [Ring](http://ring-lang.net)\n\nThe language comes with RingZip based on this library\n\n```ring\nload \"ziplib.ring\"\n\nnew Zip {\n    setFileName(\"myfile.zip\")\n    open(\"w\")\n    newEntry() {\n        open(\"test.c\")\n        writefile(\"test.c\")\n        close()\n    }\n    close()\n}\n```\n\n#### [Zig](https://ziglang.org)\n\n```shell\n$ zig build-exe main.zig -lc -lzip\n```\n\n```zig\nconst c = @cImport({\n    @cInclude(\"zip.h\");\n});\n\npub fn main() void {\n    var zip = c.zip_open(\"/tmp/zig.zip\", 6, 'w');\n    defer c.zip_close(zip);\n\n    _ = c.zip_entry_open(zip, \"test\");\n    defer _ = c.zip_entry_close(zip);\n\n    const content = \"test content\";\n    _ = c.zip_entry_write(zip, content, content.len);\n}\n```\n\n#### [Odin](https://odin-lang.org)\n\u003e Third party binding: [thechampagne/zip-odin](https://github.com/thechampagne/zip-odin)\n\n```odin\npackage main\n\nforeign import lib \"system:zip\"\n\nimport \"core:c\"\n\nforeign lib {\n    zip_open :: proc(zipname : cstring, level : c.int, mode : c.char) -\u003e rawptr ---\n\n    zip_close :: proc(zip : rawptr) ---\n\n    zip_entry_open :: proc(zip : rawptr, entryname : cstring) -\u003e c.int ---\n\n    zip_entry_close :: proc(zip : rawptr) -\u003e c.int ---\n\n    zip_entry_write :: proc(zip : rawptr, buf : rawptr, bufsize : c.size_t) -\u003e c.int ---\n}\n\nmain :: proc() {\n    zip_file := zip_open(\"odin.zip\", 6, 'w')\n    defer zip_close(zip_file)\n\n    zip_entry_open(zip_file, \"test\")\n    defer zip_entry_close(zip_file)\n\n    content := \"test content\";\n    zip_entry_write(zip_file, \u0026content, len(content))\n}\n```\n\n#### [Nim](https://nim-lang.org)\n\u003e Third party binding: [thechampagne/nimzip](https://github.com/thechampagne/nimzip)\n\n```shell\n$ nim c --passL:-lzip main.nim\n```\n\n```nim\nproc zip_open(zipname: cstring, level: cint, mode: char): pointer {.importc.}\nproc zip_close(zip: pointer) {.importc.}\nproc zip_entry_open(zip: pointer, entryname: cstring): cint {.importc.}\nproc zip_entry_close(zip: pointer): cint {.importc.}\nproc zip_entry_write(zip: pointer, buf: pointer, bufsize: csize_t): cint {.importc.}\n\nwhen isMainModule:\n  var zip = zip_open(\"/tmp/nim.zip\", 6, 'w')\n\n  discard zip_entry_open(zip, \"test\")\n\n  let content: cstring = \"test content\";\n  discard zip_entry_write(zip, content, csize_t(len(content)))\n\n  discard zip_entry_close(zip)\n  zip_close(zip)\n```\n\n#### [D](https://dlang.org)\n\u003e Third party binding: [thechampagne/zip-d](https://github.com/thechampagne/zip-d)\n\n```shell\n$ dmd -L-lzip main.d\n```\n\n```d\nextern(C) void* zip_open(const(char)* zipname, int level, char mode);\nextern(C) void zip_close(void* zip);\nextern(C) int zip_entry_open(void* zip, const(char)* entryname);\nextern(C) int zip_entry_close(void* zip);\nextern(C) int zip_entry_write(void* zip, const(void)* buf, size_t bufsize);\n\nvoid main()\n{\n  void* zip = zip_open(\"/tmp/d.zip\", 6, 'w');\n  scope(exit) zip_close(zip);\n\n  zip_entry_open(zip, \"test\");\n  scope(exit) zip_entry_close(zip);\n\n  string content = \"test content\";\n  zip_entry_write(zip, content.ptr, content.length);\n}\n```\n\n#### [Pascal](https://en.wikipedia.org/wiki/Pascal_(programming_language))\n\u003e Third party binding: [thechampagne/zip-pascal](https://github.com/thechampagne/zip-pascal)\n\n```pas\nprogram main;\n\n{$linklib c}\n{$linklib zip}\n\nuses ctypes;\n\nfunction zip_open(zipname:Pchar; level:longint; mode:char):pointer;cdecl;external;\nprocedure zip_close(zip:pointer);cdecl;external;\nfunction zip_entry_open(zip:pointer; entryname:Pchar):longint;cdecl;external;\nfunction zip_entry_close(zip:pointer):longint;cdecl;external;\nfunction zip_entry_write(zip:pointer; buf:pointer; bufsize:csize_t):longint;cdecl;external;\n\nconst\n   content: Pchar = 'test content';\nvar\n   zip : pointer;\n\nbegin\n   zip := zip_open('/tmp/pascal.zip', 6, 'w');\n\n   zip_entry_open(zip, 'test');\n\n   zip_entry_write(zip, content, strlen(content));\n   zip_entry_close(zip);\n   zip_close(zip);\nend.\n```\n\n#### [lua](https://www.lua.org/)\n\u003e Third party binding: [gynt/luamemzip](https://github.com/gynt/luamemzip)\n\n```lua\n-- Loads the luamemzip.dll\nzip = require(\"luamemzip\")\n\ncontent = \"Test content\"\n\nz = zip.zip_stream_open(nil, 6, 'w')\n\nzip.zip_entry_open(z, \"test.content\")\nzip.zip_entry_write(z, content)\nzip.zip_entry_close(z)\n\ndata = zip.zip_stream_copy(z)\n\nzip.zip_close(z)\n```\n\n### No ZIP64\n\nBy default, opening an archive for writing with the literal mode character 'w' will enable ZIP64 output. \nInternally the library sets a write flag when the mode equals the literal 'w':\n\n```zip/src/zip.c#L948-956\nmz_uint wflags = (mode == 'w') ? MZ_ZIP_FLAG_WRITE_ZIP64 : 0;\n```\n\nTo ensure the produced ZIP archive is _NOT ZIP64_, use the alternate mode value that selects the same semantic mode but does not compare equal to the literal 'w'. \nThe implementation accepts an alternate value in the switch labels (so the same behavior is selected), but only the literal 'w' triggers the automatic ZIP64 flag.\n\nConvention:\n- Use 'w' - 64 (integer value 55) when calling zip_open, zip_stream_open, etc., to select write mode without enabling ZIP64.\n- The same pattern applies to other modes: use 'r' - 64, 'a' - 64, 'd' - 64 to pick the non-ZIP64 variants.\n\n### Check out more cool projects which use this library\n\n* [Filament](https://github.com/google/filament): Filament is a real-time physically based rendering engine for Android, iOS, Linux, macOS, Windows, and WebGL. It is designed to be as small as possible and as efficient as possible on Android.\n* [Hermes JS Engine](https://github.com/facebook/hermes): Hermes is a JavaScript engine optimized for fast start-up of React Native apps on Android. It features ahead-of-time static optimization and compact bytecode.\n* [Monster Mash](https://github.com/google/monster-mash): New Sketch-Based Modeling and Animation Tool.\n* [Object-Oriented Graphics Rendering Engine](https://github.com/OGRECave/ogre): OGRE is a scene-oriented, flexible 3D engine written in C++ designed to make it easier and more intuitive for developers to produce games and demos utilising 3D hardware.\n* [Open Asset Import Library](https://github.com/assimp/assimp): A library to import and export various 3d-model-formats including scene-post-processing to generate missing render data.\n* [PowerToys](https://github.com/microsoft/PowerToys): Set of utilities for power users to tune and streamline their Windows 10 experience for greater productivity.\n* [The Ring Programming Language](https://ring-lang.github.io): Innovative and practical general-purpose multi-paradigm language.\n* [The V Programming Language](https://github.com/vlang/v): Simple, fast, safe, compiled. For developing maintainable software.\n* [TIC-80](https://github.com/nesbox/TIC-80): TIC-80 is a FREE and OPEN SOURCE fantasy computer for making, playing and sharing tiny games.\n* [Urho3D](https://github.com/urho3d/Urho3D): Urho3D is a free lightweight, cross-platform 2D and 3D game engine implemented in C++ and released under the MIT license. Greatly inspired by OGRE and Horde3D.\n* [and more...](https://grep.app/search?q=kuba--/zip)","funding_links":[],"categories":["Compression","压缩","OOM-Leaks-Crash","Maths","C"],"sub_categories":["Zip"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkuba--%2Fzip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkuba--%2Fzip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkuba--%2Fzip/lists"}