Skip to content

stdlib: Fix return value of zip:zip_get/2#11313

Open
dmitrivereshchagin wants to merge 1 commit into
erlang:maintfrom
dmitrivereshchagin:stdlib/fix-zip-get-2
Open

stdlib: Fix return value of zip:zip_get/2#11313
dmitrivereshchagin wants to merge 1 commit into
erlang:maintfrom
dmitrivereshchagin:stdlib/fix-zip-get-2

Conversation

@dmitrivereshchagin

Copy link
Copy Markdown
Contributor

When a file is extracted to a directory, the function returns a map instead of a file name:

1> {ok, {_, B}} = zip:zip("", [{"F", ~""}], [memory]), ok.
ok
2> {ok, H} = zip:zip_open(B, [{cwd, "/tmp"}]), zip:zip_get("F", H).
{ok,#{flush => [],name => "/tmp/F"}}

@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

CT Test Results

    2 files    100 suites   1h 6m 9s ⏱️
2 301 tests 2 249 ✅ 52 💤 0 ❌
2 720 runs  2 664 ✅ 56 💤 0 ❌

Results for commit e8a733e.

♻️ This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

@dmitrivereshchagin dmitrivereshchagin changed the base branch from master to maint June 30, 2026 19:12
Comment thread lib/stdlib/src/zip.erl Outdated
case get_z_file(In1, Z, Input, Output, [], fun silent/1,
CWD, ZFile, fun all/1, false, ExtraOpts) of
{file, R, _In2} -> {ok, R};
{file, R, _In2} -> {ok, Output(flush, R)};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{file, R, _In2} -> {ok, Output(flush, R)};
{file, R, _In2} -> {ok, Output(flush, R)};

When a file is extracted to a directory, the function returns a map
instead of a file name:

    1> {ok, {_, B}} = zip:zip("", [{"F", ~""}], [memory]), ok.
    ok
    2> {ok, H} = zip:zip_open(B, [{cwd, "/tmp"}]), zip:zip_get("F", H).
    {ok,#{flush => [],name => "/tmp/F"}}
@IngelaAndin IngelaAndin added the team:VM Assigned to OTP team VM label Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team:VM Assigned to OTP team VM

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants