So here is the code that I tried:
use strict; use Archive::Tar; my $filename = "filename.tar.gz"; Archive::Tar->extract_archive($filename);
As near as I can tell it just loaded (tried) into memory so it could then write out, but it ran out of memory before then. I think what this comment means to say is that if your tar file includes multiple files, it will not read them all into memory. Instead it will load a single file into memory, then write it out, then read the next file into memory, then write it out, etc.

Where I am looking to try and do something like process binary chunk write it to file, remove binary chunk from memory, repeat until done. As far as I can tell this pm, does not do that... If anyone knows better, I would really appreciate it.

Otherwise I am checking out really thin un-tar programs, like the ones mentioned in the comments to this post that I can package with my program, and just make a system call to them to handle the untar...

If anyone has any other idea, I would love to hear them. I am stuck with this file compression since it is the output of the machine.


In reply to Re^3: File list from gz file without reading everything into memory by drblove27
in thread File list from gz file without reading everything into memory by drblove27

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.