o
odinpkg.dev
packages / tool / ozip

ozip

1ac3966tool

Zip library and tool written odin

No license · updated 8 months ago

Ozip

I wrote ozip because i noticed there weren't any zip implementation written in odin and i wanted to contribute to the ecosystem and also because i really wanted to know how zip works.

Example

main :: proc()
{
    dir, err := ozip.open("Archive.zip")

    defer ozip.close(&dir)

    if err != .None
    {
        fmt.println("could not open archive", err)
        return
    }

    my_file, was_allocation, entry_err := ozip.read_entry(dir, "path/to_my_file.txt")

    if entry_err != nil 
    {
        fmt.println("error reading entry", entry_err)
        return
    }

    defer if was_allocation 
    {
        delete(my_file)
    }

    fmt.println(string(my_file))
}