在下载时解压缩/打包tar文件?(是否可以流式传输?) [英] Untar/pack a tar file while downloading? (Is it streamable?)
本文介绍了在下载时解压缩/打包tar文件?(是否可以流式传输?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我很难弄清TAR文件是如何工作的.我希望构建一个在下载tar文件时提取其文件的应用程序.但是我似乎找不到与此主题有关的任何东西.
I have a hard time figuring out how a TAR file works. I wish to build an application that extracts a tar file while it's being downloaded. But I can't seem to find anything related to this subject.
这可能吗?TAR文件在内部如何工作?我有一点感觉,这是不可能的.
Is this possible? How does a TAR file internally work? I have a small feeling that this is not going to be possible.
推荐答案
建议:
curl -s https://example.com/dir/file.tar.gz | tar zx #silent
curl https://example.com/dir/file.tar.gz | tar zx
curl https://example.com/dir/file.tar.gz | tar zvx #view files while unpacked
curl https://example.com/dir/file.tar.gz | pv -s$BYTES | tar zx #view progress
如果没有 curl
或 pv
,则可以使用 sudo apt install curl pv
或进行安装sudo yum install curl pv
.
If you don't have curl
or pv
, you might be able to install with sudo apt install curl pv
or sudo yum install curl pv
.
这篇关于在下载时解压缩/打包tar文件?(是否可以流式传输?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文