Maybe you should show us the code you tried with Archive::Tar.

Did your attempt look anything like this?

perl -MFile::Find -MArchive::Tar -e "$t=Archive::Tar->new(); find(sub{-f && $t->add_files($_)},$ARGV[0]); $t->write(join('.',$ARGV[0].'tar')" some_path
Note that the total size of the directory being treated is an important factor; if it's really big (i.e. >= your machine's RAM), Archive::Tar will cause trouble, because all the data needs to be memory resident (with substantial overhead) before a tar file can be written. "Trouble" here could mean anything from "just slows everything down a lot" (because of massive virtual memory swapping) to "blue screen of death" (due to some critical state caused by over-consumption of resources).

If there are ways to break up a large data set into pieces of reasonable size (and if it's not absurd to make a separate tar file for each piece), then that will be the way to go.

I just tried a command line like the one above (but with different quotes, because I prefer a bash shell -- I'm not sure if the snippet as posted would actually work in cmd.exe). It did the job -- even with a directory tree totaling 2.3 GB of data; I happened to have an 8 GB swap file. (But I wasn't using windows, so YMMV.)

(updated last paragraph, trying to clarify about the quoting issue -- and regarding memory size, I have 2G of RAM, but the total process size for that command went well over 3G)

I'll add one more comment: Being on windows is not a good excuse for not having a proper compiled GNU tar tool. If you don't have admin privilege on the box, the question becomes: why can't your admin person provide this tool for you? If you have perl on the box, you should be able to get at least some amount of cygwin or uwin or some other flavor of unix-for-windows tools (including a bash shell, while you're at it).

Last additional comment: Why is a zip file not good enough, given that you were already able to create that easily? Virtually every OS on every kind of hardware has a tool available for reading zip files, and this has been true for a long time. Worst case: make a zip file, send it to a friend who is better equipped than you are, and have them repackage it in tar format for you.


In reply to Re: Question on Archive::Tar vs Archive::TarGzip by graff
in thread Question on Archive::Tar vs Archive::TarGzip by jujiro_eb

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.