[erlang-questions] [bug] zip archives in memory (patch incl.)
Wed Apr 2 13:27:21 CEST 2008
I've found two bugs regarding handling zip archives in memory. The
attached patch solves both of them, it has been tested with R11B5 and
should work with R12B1 as well.
1. When decompressing from memory (ie. the archive given as a binary to
extract/2), the decompression crashes when the archive contains a directory.
This is because get_z_file/7 returns In accumulator (when it encounters
a directory), which is a tuple in case of binary_io/2, but the calling
get_z_files/5 function undestands the tuple as a return value and a new
2. When decompressing to memory (ie. with the 'memory' option passed to
extract/2), the directories found in the archive are created on the real
This is because filelib:ensure_dir/1 is called in get_z_file/7 no matter
which function (file_io/2 or binary_io/2) has been selected for output.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1884 bytes
Desc: not available
More information about the erlang-questions