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

How do you decompress tar.xz files? #1

Open
fire opened this issue Jan 31, 2015 · 3 comments
Open

How do you decompress tar.xz files? #1

fire opened this issue Jan 31, 2015 · 3 comments
Assignees
Milestone

Comments

@fire
Copy link

fire commented Jan 31, 2015

Trying to discover how to extract tar.xz files. Is this possible?

@skull-squadron
Copy link

First, decompress the *.tar.xz to a *.tar, either to memory or a temporary file. Then use a tar decompressor (i.e., import "archive/tar") on that.

A working xz decompressor is needed first; and this seems to be alpha software currently.

@ulikunitz
Copy link
Owner

Many thanks for the interest in my code. The code is not even alpha right now. Currently the software contains working code for the LZMA method. This is the core compression method used by xz file format. But actually xz is using LZMA2 that contains chunks of LZMA compressed data. So I'm working currently on LZMA2.

When the code will be complete, I will provide examples on how to create and decompress tar files in Go.

@ulikunitz ulikunitz added this to the v1.0 milestone Feb 26, 2015
@ulikunitz ulikunitz reopened this Feb 26, 2015
@ulikunitz ulikunitz self-assigned this Feb 26, 2015
@mholt
Copy link

mholt commented Nov 30, 2016

Easy: https://github.com/mholt/archiver/blob/cdc68dd1f170b8dfc1a0d2231b5bb0967ed67006/tarxz.go#L53-L66

(Opening the .tar file is the "hard" part, but the xz decompression just gets layered on underneath it as you can see.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants