Bug 13160 – ZipArchive.directory do not support read files with more than 65000 entries
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2014-07-19T12:47:15Z
Last change time
2019-11-20T17:54:49Z
Assigned to
No Owner
Creator
Domingo Alvarez Duarte
Comments
Comment #0 by mingodad — 2014-07-19T12:47:15Z
Reading a post on D language forum I saw an answer with a snippet to read big zip files using memory mapped files, when I tried it with a zip file with more than 65000 entries it fails with:
----
std.zip.ZipException@../../../../src/libphobos/src/std/zip.d(49): ZipException: invalid directory entry 3
----------------
./zipTest() [0x403aca]
./zipTest() [0x41486f]
./zipTest() [0x414fcf]
./zipTest() [0x415200]
./zipTest() [0x414fcf]
./zipTest() [0x415168]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7f5c4e90e76d]
./zipTest() [0x4038b9]
----------------
======
import std.stdio, std.zip, std.file, std.mmfile;
int main()
{
auto mmfile = new MmFile(File("more-than-65000-entries.zip", "rb"));
auto zip = new ZipArchive(mmfile[]);
foreach (item; zip.directory) {
writeln("processing ", item.name, " ...");
// processing item...
}
return 0;
}
======