How can I tar files more physical memory using Perl Archive :: Tar?

I am using Perl Archive :: Tar . The problem is that it pushes everything into memory and does archiving, and then writes it to the file system, so there is a limit on the maximum file size that can be archived. In most cases, this indicates a lack of memory. In the case of GNU tar, it takes a fragment of a file, archives it, and writes it to memory so that it can process files of any size. How to do this using the Perl Archive :: Tar module.

+6
perl tar archive
source share
2 answers

There seems to be another module that does not use a structure in memory: Archive :: Tar :: Streamed . The disadvantage is that it requires tar to be available on the system on which it is running. However, this is better than the puppet itself.

+6
source share

Looks like Archive :: Tar :: Wrapper is your best bet. I have not tried it myself, but it uses your system tar executable and does not store the files in memory.

Contrary to the Hour. Owen's answer, Archive :: Tar :: Streamed does store files in memory, rather than using your tar system. It actually uses Archive :: Tar internally, but processes one file at a time (taking advantage of the fact that tar archives can be combined). This means that Archive :: Tar :: Streamed can process archives larger than memory if each individual file in the archive fits in memory. But that is not what you asked for.

+12
source share

All Articles