-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
proposal: x/tools/txtar: add Extract function or method #61386
Comments
Written a while back, but it might be useful: https://pkg.go.dev/github.com/rogpeppe/go-internal/txtar#Write cc @rogpeppe @myitcv Also, shouldn't we use #56219? |
Personally I only use txtar for tests, but rejecting up-level references seems prudent. I'm less convinced about O_EXCL: I expect an extract operation to write files, even over existing ones. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as resolved.
This comment was marked as resolved.
alternatively, |
This comment was marked as off-topic.
This comment was marked as off-topic.
I'm fine with this as txtar.Extract, but the implementation should use filepath.ToSlash and filepath.IsLocal, as @mvdan noted. I would rather not introduce a method since right now the Archive type is trivial, pure data, and I'd like to keep it that way. |
This proposal has been added to the active column of the proposals project |
If we do #44158 and then add os.CopyFS from #45757 (comment), then like @seankhliao said above, that seems like a nicer outcome. We would have to figure out what to do about txtar files that say ../ at the start, but archive/zip has to do that too and we can do whatever it does (drop them?). |
This proposal has been declined as retracted. |
While developing tests, I've written this function at least four times this week:
I propose that we add it to the txtar package, either as a function or a method of Archive.
The text was updated successfully, but these errors were encountered: