Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deflate64 is unsupported #66

Open
mramato opened this issue Sep 13, 2023 · 3 comments
Open

deflate64 is unsupported #66

mramato opened this issue Sep 13, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@mramato
Copy link
Contributor

mramato commented Sep 13, 2023

  • Windows Explorer always uses deflate64 for zip files over 2 GB
  • node-stream-zip does not support deflate64, so any zip file using it fails.
@mramato mramato added the bug Something isn't working label Sep 13, 2023
@javagl
Copy link
Contributor

javagl commented Sep 14, 2023

Oh... that's subtle ...

Cesium Deflate64

😕

If you have any recommendations for alternative ZIP libraries, I'll have a look. Otherwise, I'll have a look at one of these 6302 libraries...

@mramato
Copy link
Contributor Author

mramato commented Sep 14, 2023

@javagl Unfortunately I don't think one exists. This doesn't affect my project directly, but I wanted to write it up since we noticed it.

@javagl
Copy link
Contributor

javagl commented Sep 15, 2023

I could reproduce this by creating a ZIP that uses Defalte64.


An aside: The Windows Explorer does not always seem to use it, even for large archives. From a quick test, it seemed that

  • compressing a directory with many files (and >4GB) still used Deflate
  • compressing the same files in that directory directly (by selecting them all and adding them to a ZIP) caused it to use Deflate64
    Whatever the reason for that is.

In 7zip, the method can be selected explicitly, so that's an option for creating test data.


I have no idea how to resolve this, though. There does not seem to be any library that supports Deflate64. Even the zlib FAQ just say:

Does zlib support the new "Deflate64" format introduced by PKWare?

No. PKWare has apparently decided to keep that format proprietary, since they have not documented it as they have previous compression formats. In any case, the compression improvements are so modest compared to other more modern approaches, that it's not worth the effort to implement.

So we're out of luck here. If that comes up in practice, the only solution would be: Unpack that archive (in doubt, with some command-line call), and pass in the resulting directory.


Unrelated: I'm pretty sure that there is a bug related to that lurking in node-stream-zip which tries to use zlib for uncompressing Deflate64 data in the synchronous case, but not in the stream case, but that's none of our business for now...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants