geocar / zipwriter

This is a library for writing zipfiles.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This is a library for writing zipfiles.

It's most notable feature is that it is not based on Info-Zip, but it's also
very easy to use:

    #include "zipwriter.h"

    #include <unistd.h>
    #include <fcntl.h>

    int main(int argc, char *argv[])
    {
            zipwriter *z;
            zipwriter_file *f;

            z = zipwriter_start(open("test.zip", O_RDWR|O_CREAT|O_TRUNC, 0666));
            f = zipwriter_addfile(z, "test.txt", ZIPWRITER_DEFLATE9);
            zipwriter_write(f, "Hello World!\n", 12);
            if (!zipwriter_finish(z)) { /* note this closes the file! */
                    puts("err");
                    exit(1);
            }
            exit(0);
    }

A more sophisticated example is included in "bundle.c" which will package up
this program in a zipfile.

About

This is a library for writing zipfiles.

License:GNU General Public License v2.0


Languages

Language:C 100.0%