-
Notifications
You must be signed in to change notification settings - Fork 5
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
add zip64 support #7
base: master
Are you sure you want to change the base?
Conversation
ctx[:csize] :: size(32)-little, | ||
ctx[:usize] :: size(32)-little | ||
ctx[:csize] :: size(64)-little, | ||
ctx[:usize] :: size(64)-little |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT
4.3.9.2 When compressing files, compressed and uncompressed sizes SHOULD be stored in ZIP64 format (as 8 byte values) when a file's size exceeds 0xFFFFFFFF. However ZIP64 format MAY be used regardless of the size of a file. When extracting, if the zip64 extended information extra field is present for the file the compressed and uncompressed sizes will be 8 byte values.
When streaming we don't know upfront whether there will be any big files. Maybe the first file is < 4 Gb but the second can be > 4 Gb. However we have to choose if we're going to use 64-bit extensions or not when streaming the first file. So this code assumes to use ZIP64 in any case.
@@ -3,9 +3,7 @@ defmodule Zipflow.Spec.CDHTest do | |||
|
|||
alias Zipflow.Spec.CDH | |||
|
|||
test "encode returns ()" do | |||
ans = CDH.encode(fn x -> assert is_binary(x); nil end, []) | |||
assert () == ans |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This causes a warning in modern Elixir versions.
@dgvncsz0f could you please review this? |
Too bad this never got a response :( |
This enables support of files > 4 Gb and archives > 4 Gb in total.