How can I decompress an archive file having tar.zst?

二次信任 提交于 2019-12-18 18:51:12

问题


I do not know how I can decompress a file having tar.zst extension and even though I did look for solutions on the Internet I ended up having nothing useful regarding the matter.


回答1:


The extention .zst means that the archive is compressed by zstd.

  • https://github.com/facebook/zstd

The tar command has an option -I (--use-compress-program) to specify a command for compression/decompression.

You can use it as follows.

$ tar -I zstd -xvf archive.tar.zst




回答2:


Decompress it in Terminal.

unzstd yourfilename.zst

I know there aren't many resources available but I found this here: http://manpages.org/zstd




回答3:


If you have a standard cmake + gcc build stack:

git clone https://github.com/facebook/zstd.git
cd zstd/build/cmake
cmake .
make
./programs/zstd -d /path/to/file.zst



回答4:


Download the library

https://pypi.org/project/zstandard/

Python

 import zstandard as zstd
 ...
 ...
 ...
 ...
 elif filename_extension == ".zst":
     dctx = zstd.ZstdDecompressor()
     with open(submission_path_read, 'rb') as ifh, open(submission_path_save, 'wb') as ofh:
        dctx.copy_stream(ifh, ofh, write_size=65536)


来源:https://stackoverflow.com/questions/45355277/how-can-i-decompress-an-archive-file-having-tar-zst

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!