One idea i have is using File::Find and displaying something like dots on the screen after each copy operation has taken place, but this does not give a realistic progress bar as one file might be in the size of 1 gig in size and the user might be unsure of whether or not the copying is in progress.

I personally believe that no progress bar in the whole universe has ever given realistic info, but that of the supa dupa new gen coffee machine they installed at my last employer's! (The very second the cool electric blue light of the bar would touch the end mark, the very last drop of coffee would be spilled into the "glass" and the machine would make 'ding' for you to extract it and happily drink it!) But seriously, I think that your proposed strategy -i.e. sticking to the granularity of atomic copies- is fine enough: only, at some times one would see the progress bar seemingly not proceeding if some very big file is taking too time to be copied - which is what I gather may happen in your case. For otherwise you should either hack into some file copying modules: a literal overkill! or work around with some estimate: which would be both an overkill and prone to be imprecise, like all estimates.

The point to which I wanted to draw your attention is rather that whatever file copying strategy and whatever progress bar technique you choose amongst the many ones that were proposed to you in this rich thread, if you want your progress bar to be accurate, i.e. to reach the end mark as the copy process also terminates, then you have to gather all the files you have to copy in advance whereas if you hadn't such a requirement, you may start copying files as soon as they're found by your favourite file finding module...

--
If you can't understand the incipit, then please check the IPB Campaign.

In reply to Re: Copying a directory and its contents wihile displaying a progress bar by blazar
in thread Copying a directory and its contents wihile displaying a progress bar by bittis

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.