Skip to content

archive/zip: Header<->os.FileInfo functions #2186

@mark-summerfield

Description

@mark-summerfield
The zip package has a FileHeader struct that uses the fields required by zip files.
Unfortunately these fields do not map nicely to os.FileInfo fields.

I think it would be helpful to provide conversion functions:

zip.HeaderForInfo(*os.FileInfo) *zip.FileHeader
zip.InfoForHeader(*zip.FileHeader) *.os.FileInfo

This would be particularly convenient when it comes to date/time and permissions
handling.

Similar functions would also be helpful (but not as necesary) in the tar package.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions