Skip to content

docs error in erl_tar:init/3 #10291

@sg2342

Description

@sg2342

Describe the bug
erl_tar:init/3 example code in

https://www.erlang.org/docs/28/apps/stdlib/erl_tar.html#init/3

{ok,Fd} = file:open(Name, ...).
{ok,TarDesc} = erl_tar:init(Fd, [write], ExampleFun),

is wrong since it uses [write] as the second argument of erl_tar:init/3 while only read or write are valid here.

if the returned TarDesc is used in erl_tar:add/3, the call will crash with badarg.

Expected behavior
Correct documentation

Affected versions
all versions since OTP 22

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue is reported as a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions