Giter Site home page Giter Site logo

support 'deflate64'? about flate2-rs HOT 6 CLOSED

xudesheng avatar xudesheng commented on June 8, 2024
support 'deflate64'?

from flate2-rs.

Comments (6)

xudesheng avatar xudesheng commented on June 8, 2024 1

@Byron @oyvindln Thank you for your response!
@Byron My issue is about something other than adding large files. I need to read the content from the zip file which the Windows user generates to be used in my tool. My tool works fine if the zip file is not using the Deflate64 algorithm, even when the size is more significant than 2G.

However, it seems like Windows would automatically use the Deflate64 algorithm when the user is trying to compress files larger than 2G. I am curious to know whether the Windows user has the option to choose the algorithm or not ( I guess not).

@oyvindln I fully understood why the Deflate64 algorithm is not part of the underline zlib. But the headache is that Windows is so popular; on the other side, Windows makes this algorithm the default (transparent to the end-user) even though the benefit is very marginal. So, I have to consider how to support it in my tool. I agree with you that keeping it in zlib/miniz_oxide is better.

from flate2-rs.

robjtede avatar robjtede commented on June 8, 2024 1

This popped up today: https://crates.io/crates/deflate64

from flate2-rs.

Byron avatar Byron commented on June 8, 2024 1

Thanks for sharing! I think in order to resolve this particular problem, it's more likely that zip-rs will make use of the deflate64 crate than flate2 to learn how to decode such streams.

I am following the new issue over on zip-rs to stay in the loop though.

from flate2-rs.

Byron avatar Byron commented on June 8, 2024

I have created an example as well and can add files larger than 4GB without problems.
Could you add a program that reproduces the issue here?

from flate2-rs.

oyvindln avatar oyvindln commented on June 8, 2024

DEFLATE64 is not supported by any of the underlying libraries (zlib, zlib_ng, miniz_oxide - though zlib has some separate source code for decompressing it in it's contrib section). zip can handle >2G files fine with the normal deflate algorithm. The ZIP64 extension to the zip format is what's used for that to handle the 32-bit size issue from the original spec.

That's is not the same thing DEFLATE64. Apparently the zip compressor in windows uses DEFLATE64 on >2G files still for whatever reason otherwise there wouldn't be much use for for libraries/apps dealing with the .zip format to have support for it as it doesn't seem to give all that much advantage over standard DEFLATE and there are better and more modern algorithms like LZMA etc if you want something better than DEFLATE.

I don't know how much it differs from standard DEFLATE and how much it would take to e.g implement it in miniz_oxide. Since it's still not in zlib after all these years I wouldn't expect to see it in there any time soon. If support is added in one of the underlying libraries it would make sense adding the glue logic to swap method to flate2 as well but it's kinda borderline in scope here. If it differs enough that it would make more sense as a separate librarly to zlib/miniz_oxide it would probably not make sense to include with flate2.

from flate2-rs.

xudesheng avatar xudesheng commented on June 8, 2024

This popped up today: https://crates.io/crates/deflate64

Hope the zip-rs crate can leverage this and support deflate64 when unzip.

from flate2-rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.