Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add name_in_archive option to erl_tar:add/3 #105

Closed
wants to merge 1 commit into from

Conversation

rimmius
Copy link
Contributor

@rimmius rimmius commented Oct 16, 2013

There are 2 erl_tar:add(). One has an option as an extra argument.
It is better to allow this option to be part of the normal options.
The extra function is kept for backwards compatibility.

There are 2 erl_tar:add(). One has an option as an extra argument.
It is better to allow this option to be part of the normal options.
The extra function is kept for backwards compatibility.
@OTP-Maintainer
Copy link

Patch has passed first testings and has been assigned to be reviewed

@@ -77,7 +77,8 @@ close(_) ->
%% Adds a file to a tape archive.

add(File, Name, Options) ->
add(File, Name, Name, Options).
NameInArchive = proplists:get_value( name_in_archive, Options, Name ),
Copy link
Contributor

Choose a reason for hiding this comment

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

Code style violation: There should be no extra spaces after a '(' and before a ')'.

Copy link

Choose a reason for hiding this comment

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

Sorry about the style violation. If the patch is found worthy I will adjust the style.

@bjorng
Copy link
Contributor

bjorng commented Oct 23, 2013

Can you explain why it would be better to have the name of the file file in the option list instead of an extra agurment?

Since I would expect each file added to a tar file to have a unique name, having to put a new name into the option list for each call to erl_tar:add/3 does not seem any easier or more logical to me.

@ebengt
Copy link

ebengt commented Oct 25, 2013

It is (slightly) more consistent to have all options in the Options variable. To single out one option (name_in_archive) and let it be an extra argument (see erl_tar:add/4) does not agree with me.

@bjorng bjorng closed this Feb 17, 2014
uabboli pushed a commit to uabboli/otp that referenced this pull request Dec 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants