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

add zip64 support #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

feymartynov
Copy link
Contributor

This enables support of files > 4 Gb and archives > 4 Gb in total.

ctx[:csize] :: size(32)-little,
ctx[:usize] :: size(32)-little
ctx[:csize] :: size(64)-little,
ctx[:usize] :: size(64)-little
Copy link
Contributor Author

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
Copy link
Contributor Author

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.

@feymartynov
Copy link
Contributor Author

@dgvncsz0f could you please review this?

@1st8
Copy link

1st8 commented Sep 6, 2019

Too bad this never got a response :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants