Wow.

Really wow.

This does work, but at first it really seemed to me like it couldn't work. I didn't understand it yesterday, didn't understand it today, even downvoted it, got suspicious when I saw its noderep, tried to write a reply where I argue how this can't possibly work, and only understood how it could work during that. So I downloaded the cpan module, tested it, and it worked.

It might have been better if you wrote a bit more comments about it.

For anyone else puzzled, this overrides a private function from the File::Copy::Recursive cpan module. That function is called recursively on each file so this overriding code can print a debug output saying what file is copied. The title is confusing, because it doesn't actually display a progress bar, only prints the name of each file as it's copied. You use the code by calling the dircopy function with a source and target directory name.

Update: By the way, I won't use this code, because I don't seem to ever need copying files recursively from a script, and because cp -av works well enough.


In reply to Re: Copying a directory and its contents while displaying a progress bar by ambrus
in thread Copying a directory and its contents while displaying a status by hiseldl

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.