Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
Make sure that zip:extract() and zip:create() closes the zip
file if there is an error.
ERL-349
|
|
There is unfinished code in the zip module to handle the
extra field in the central-directory header for each
file. The code to extract an Unix extra subfield is incorrect
and always causes a bad_unix_extra_field error. A further
flaw in the code is that it expects that there is only
a single subfield.
Correcting the code for extracting extra subfields will not do any
good, because the extracted data is ignored. In fact, not even the
file times extracted from DOS file times are used for some reason.
Therefore, don't correct the unfinished code. Remove it completely.
(If needed, extending zip to use file times and to use the information
in the extra field should be done in a major release, not in a
maintenance release.)
ERL-348
|
|
|
|
|
|
Optimize the case where we are appending to the end of the binary, use
binary syntax to create binaries with room for expansion in the next
loop, instead of using iolist_to_binary which creates a binary of the
exact size and needs to be copied in each loop.
Also remove support the unused Acc as iolists.
|
|
|
|
* erlang/pr/745:
Typofix: piecemeal
|
|
|
|
A warning for an unmatched return was introduced in aaa7c917.
The caller of openzip_close/1 ignores the return value, which
could be an error tuple. In this situation, handling a fatal
error, it is OK to ignore the return value; thus, we only need
to make it explicit that we are ignoring the return value.
|
|
These are not intended to be treated as processes by consumers, and the
type specs for the related functions have been updated accordingly.
|
|
The case was discovered where a parent process would exit before closing
the zip file. The result was that a port would be left open
indefinitely, as the small zip server would not detect this condition.
By comparison, the file module will close the associated port when the
parent exits for any reason. This change would make the zip module more
consistent with the semantics of similar modules.
This change is breaking for any callers expecting to pass the handle to
another process for processing (assuming it exits).
|
|
escript:create/2 accepts a 3-elements tuple containing files and
zip:create/3 options to build a zip file.
Also had to update zip typespecs to allow referral from escript docs.
|
|
|
|
|
|
|
|
|
|
zip:zip_open/1,2 did not accept binary archives.
Also corrected the contracts of t/1 and tt/1.
|
|
The contracts of zip:zip_list_dir/1 and zip:zip_get/2 have been
corrected.
|
|
|
|
This is the public interface of prim_zip:open/3,
which has been used in earlier releases by both
erl_prim_loader and escript. The new function
can be used as a replacement for the undocumented
function escript:foldl/3 that is likely to be
removed without further notice.
The error handling of prim_zip:open/3 (and
prim_zip:foldl/3) has been improved in order to
better suite a public interface. For example it
could happen that a file or a zlib port could be
left open in some errors cases.
The documentation of the FileSpec parameter to
zip:create/3 has been updated to show that
file info can be explicitly specified. A FileSpec
may contain {Filename, binary(), #file_info{}}
elements. The function zip:create/3 was already
prepared to partly support this, but now after
a few minor fixes it is fully supported.
|
|
|
|
|