Skip to content

archive/zip: support "end of central directory record comment" (not file header comment) #21634

Description

@yanolab

ZIP formart has 2 types comment.
First, Central directory file header comment. This is already supported.
Second, End of central directory record comment. Read this comment is supported, but Write is not supported yet.

(more detail of zip format, see also: https://en.wikipedia.org/wiki/Zip_(file_format))

Not supported go source code is bellow.
https://github.com/golang/go/blob/master/src/archive/zip/writer.go#L185

I think following commit is mistake, because file header comment had been supported since Go1 released.
bcc349a

I propose to support "end of central directory record comment".

Proposal:

Add SetComment method to zip.Writer, such as bellow.

def (w *Writer) SetComment(c string) error

I will send patch if this proposal is acceptable.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions