Skip to content
forked from STARRY-S/zip

Go zip library with Append (Updater) support.

License

Notifications You must be signed in to change notification settings

Meteologica/zip

This branch is 18 commits ahead of, 4 commits behind STARRY-S/zip:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

f9ed4ac · May 31, 2024

History

34 Commits
Mar 20, 2024
Apr 21, 2024
Mar 20, 2024
May 31, 2024
Mar 20, 2024
Mar 20, 2024
May 31, 2024
May 31, 2024
May 31, 2024
Nov 5, 2023
Mar 20, 2024
May 31, 2024
May 31, 2024
Apr 25, 2024
May 31, 2024
May 31, 2024

Repository files navigation

Go zip library

This project is based on the archive/zip Go standard library. It adds a new Updater struct that allows appending new files to the existing zip archive without having to decompress the whole file, and allows overwriting of files already stored in the zip archive.

Usage

import "github.com/meteologica/zip"
// Open an existing test.zip archive with read/write only mode for Updater.
f, err := os.OpenFile("test.zip", os.O_RDWR, 0)
handleErr(err)
zu, err := zip.NewUpdater(f)
handleErr(err)
defer zu.Close()

// Updater supports modify the zip comment.
err = zu.SetComment("Test update zip archive")
handleErr(err)

// Append a new file into existing archive.
// The Append method will create a new io.Writer.
w, err := zu.Append("example.txt")
handleErr(err)
// Write data into writer.
_, err = w.Write([]byte("hello world"))
handleErr(err)

Example test code: updater_example_test.go.

License

BSD 3-Clause

The zip library is based on Go standard library.

About

Go zip library with Append (Updater) support.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%