in reply to Re: Archive::tar - out of memory - 3,2GB
in thread Archive::tar - out of memory - 3,2GB

Hi Corion, thanks for your reply.

So Archive::Tar->iter would be the solution, right?
But for me it is not clear from the examlpe how I can add the files with this to a tar/gzip as it is saying it is reading the tarball.

Can you help me with a code example how I can add files with this method?

Thanks a lot.
regards
de Michi

Replies are listed 'Best First'.
Re^3: Archive::tar - out of memory - 3,2GB
by Corion (Patriarch) on Jun 13, 2014 at 09:30 UTC

    It seems that Archive::Tar will always create the archive in memory before writing it out and has no incremental way of building an archive.

      okay .. can you recommend another way of archiving/zipping where I can fix this issue?

        If you have an external tar executable, I would use that to create the tar file and append the files to the archive. There seems to be Archive::Tar::Wrapper, which should make switching from Archive::Tar trivial.

        There also is Archive::Tar::Stream, which has a different API but should be able to just append files with the ->AddFile() call.