如何使用 Perl 的 Archive::Tar 压缩比物理内存大的文件? [英] How can I tar files larger than physical memory using Perl's Archive::Tar?

查看:15
本文介绍了如何使用 Perl 的 Archive::Tar 压缩比物理内存大的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Perl 的 Archive::Tar 模块.它的问题在于它将所有内容都拉入内存并进行存档,然后写入文件系统,因此可以存档的最大文件大小受到限制.大多数时候它说内存不足.在 GNU tar 的情况下,它需要一个文件块,将其存档并将其写入内存,以便它可以处理任何大小的文件.我怎样才能使用 Perl 的 Archive::Tar 模块做到这一点.

I'm using Perl's Archive::Tar module. Problem with it is it pulls everything on to the memory and the does archiving and then writes on to the file system so there is limitation on the maximum file size that can be archived. Most of the times it says out of memory. In case of GNU tar, it takes chunk of file, archives it and writes it on to the memory so it can handle files of any size. How can I do that using Perl's Archive::Tar module.

推荐答案

看起来有一个不同的模块不使用内存结构:Archive::Tar::Streamed.缺点是它需要 tar 在运行它的系统上可用.尽管如此,它还是比你自己串串焦油要好.

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.

这篇关于如何使用 Perl 的 Archive::Tar 压缩比物理内存大的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆