How can I tar files larger than physical memory using Perl's Archive::Tar?

时光总嘲笑我的痴心妄想 提交于 2019-12-04 06:47:15

It looks like there is a different module that doesn't use an in-memory structure: Archive::Tar::Streamed. The downside is that it requires tar to be available on the system it is run on. Still, it is better than puppet-stringing tar yourself.

It looks like Archive::Tar::Wrapper is your best bet. I've not tried it myself, but it uses your system's tar executable and doesn't keep files in memory.

Contrary to Chas. Owen's answer, Archive::Tar::Streamed does keep files in memory and does not use your system's tar. It actually uses Archive::Tar internally, but it processes one file at a time (taking advantage of the fact that tar archives can be concatenated). This means that Archive::Tar::Streamed can handle archives bigger than memory, as long as each individual file in the archive will fit in memory. But that's not what you asked for.

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