You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.
In all of the implementations of Archiver a hard-coded CheckExt is being invoked within Archive func. I propose removing this check from Archive and Unarchive and instead move it to the code that e.g. determines Archiver to be used. The operations of specific Archiver should not do any extension checking.
Why is this feature a useful, necessary, and/or important addition to this project?
When using archiver as library there are plenty of scenarios (e.g. temp files, in-memory files being compressed before transfer as a payload, number of well-known file names that internally are just archives, etc.) when file extension is just irrelevant. When selecting archiver implementation e.g. by archiver.DefaultTar the decision about format is already carried out so checking for extension within funcs of selected implementation seems to be redundant.
What alternatives are there, or what are you doing in the meantime to work around the lack of this feature?
Current hack is to always create a temp file with the required extension and copy stuff back and forth, which causes boiler-plate code and additional ways to break code.
Please link to any relevant issues, pull requests, or other discussions.
It's your lucky day, #302 does this. I completely redesigned this package and its core APIs don't rely on the file extension anymore (except for an optional Identify() function that can optionally use the file extension -- or the stream contents directly -- to match formats). That PR will become the basis for v4. Please try it out!
What would you like to have changed?
In all of the implementations of
Archiver
a hard-codedCheckExt
is being invoked withinArchive
func. I propose removing this check fromArchive
andUnarchive
and instead move it to the code that e.g. determinesArchiver
to be used. The operations of specificArchiver
should not do any extension checking.Why is this feature a useful, necessary, and/or important addition to this project?
When using archiver as library there are plenty of scenarios (e.g. temp files, in-memory files being compressed before transfer as a payload, number of well-known file names that internally are just archives, etc.) when file extension is just irrelevant. When selecting archiver implementation e.g. by
archiver.DefaultTar
the decision about format is already carried out so checking for extension within funcs of selected implementation seems to be redundant.What alternatives are there, or what are you doing in the meantime to work around the lack of this feature?
Current hack is to always create a temp file with the required extension and copy stuff back and forth, which causes boiler-plate code and additional ways to break code.
Please link to any relevant issues, pull requests, or other discussions.
Similar request here: #255
The text was updated successfully, but these errors were encountered: