zip append

718 views
Skip to first unread message

roger peppe

unread,
Jan 27, 2016, 7:21:54 AM1/27/16
to golang-dev
As part of some other work, I had the need to append
to a zip archive, so I forked archive/zip and added
zip.Reader.Append [1]. It wasn't that much code [2],
and I don't like forking stdlib packages, so...
might this might be a reasonable addition to the
stdlib archive/zip package?

[1] https://godoc.org/github.com/juju/zip#Reader.Append
[2] https://github.com/juju/zip/pull/1/files

Russ Cox

unread,
Jan 27, 2016, 8:19:54 AM1/27/16
to roger peppe, golang-dev
Sure, but please wait for Go 1.7. Also that's a surprisingly limited API. Normally I would expect you'd want to actually replace files. And what about updating the end-of-zip-file table of contents? How does that happen?

Russ



--
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Benny Siegert

unread,
Jan 27, 2016, 5:24:48 PM1/27/16
to Russ Cox, roger peppe, golang-dev
I have not looked at the code in detail, but usually, when you append to a zip file, you write a new TOC that replaces the older one in the middle.
Reply all
Reply to author
Forward
0 new messages