in reply to Copying a directory and its contents wihile displaying a progress bar

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.
  • Comment on Re: Copying a directory and its contents wihile displaying a progress bar
  • Download Code