Skip to content

Allow for raising a standardized Error if the zip file requires ZIP64 extensions (opt-in) #376

@nglevin

Description

@nglevin

Is your feature request related to a problem? Please describe.
Not all tooling knows how to handle a zip file with ZIP64 extensions. In the past, macOS ditto and by proxy ipatool (for App Thinning in Xcode) are picky in that they do not handle zip files with ZIP64 extensions.

Describe the solution you'd like
Python has a fairly clean way of getting around this with its zipfile module; https://docs.python.org/3/library/zipfile.html#zipfile.LargeZipFile is thrown if the zipfile was initialized with allowZip64=False.

Ideally, ZIPFoundation would have a similar facility, an instance variable that can be set in the Archive initializer that wouldn't be mutable to ensure that as the generated archive grows (or even on init from an existing zip file), it stays below the required parameters where ZIP64 becomes necessary.

Describe alternatives you've considered
One alternative that wouldn't require changes to ZIPFoundation is to explicitly check isZip64 on the Entry after completing a sequence of modifications to the Archive and throw with a custom error if isZip64 == true.

This seems to be an acceptable alternative to having the check be built into the ZIPFoundation Archive implementation, though it puts the burden of responsibility on the user of ZIPFoundation to make sure that, if they don't want to generate ZIP64 extended zip files, they have to perform that verification themselves before they finish the process to generate or modify the zip file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions