This is the comment, from the Archive::Zip CPAN document's Overview section, which is not clear. Specifically, does this mean that files on disk which have NOT YET been written to an archive are merely pointed to when I perform a $tar->addfile(xxxxx)?

I think so. My guess is that $tar->addfile(...) just writes some headers and the filename to the $tar object (or some inner object), and the final $tar->writeToFileNamed('some.zip') actually reads and compresses all files.

You can look at the source of Archive::Zip right on the CPAN website. Finding out what happens inside writeToFileNamed should be quite easy. Archive::Zip does not use XS, it's a plain perl module. A nasty litte detail is that Archive::Zip->new() does not return an Archive::Zip object, but an Archive::Zip::Archive object. So you want to search for writeToFileNamed() in Archive/Zip/Archive.pm. writeToFileNamed() wraps wrapToFileHandle(). From there, each member of the archive (which is a different object) writes itself to the file handle, using its _writeToFileHandle() method.

My guess from here is that member objects are instances of Archive::Zip::Member or Archive::Zip::FileMember. (Would have to search for what addfile() does.) Archive::Zip::FileMember class inherits most code from Archive::Zip::Member. Following the code there leads to _writeData(), that seems to read from the original file using readChunk() and to write to the archive.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

In reply to Re^2: Memory limits on Tar modules by afoken
in thread Memory limits on Tar modules by murrayn

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.