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

I know you can use Smart::Comments to display a progress bar. I read it slows down the program- but likely at compilation time and should make absolutely no difference in your case- since we are already anticipating it may take a while.

Is the interface to your software via the terminal? Is this an educated user, thus? Why wouldn't they just use use 'top' ?

How are you getting a list of files to copy? Are you making a system call like 'cp -R ./fromdir ./todir', or are you using File::Find, and then File::Copy one by one?

Why is it taking so long, for a gig?

What's 'so long'? A minute, twenty.. What speed is your hard drive read/write rate- 44100 rpm ? 15000 rpm? What's your filesystem? What's your operating system?

Would you consider benchmarking the difference between copying 1 gig via File::Copy and system cp ?

I have some code that creates random junk on disk to benchmark md5 sum calls, might be useful.

  • Comment on Re: Copying a directory and its contents wihile displaying a progress bar

Replies are listed 'Best First'.
Re^2: Copying a directory and its contents wihile displaying a progress bar
by bittis (Sexton) on Aug 04, 2008 at 16:17 UTC
    Hey there, my situation is this, i will be checking if the user plugged in an external usb hard drive (checking the label of the drive + some other checks) and then i will be copying one directory from there to the local hard drive. Files in that directory will vary in size from 1 mb to 1.5 gig in some instances (not always). It currently takes around 5 minutes to copy from e:\myFolder to c:\myFolder if i do it using windows explorer. I have not decided how i will copy the files as it will depend on how i can get that progress bar or an indication of how long it will take. My idea so far is to use File::Find as i can atleast give the user an indication of what is happening at the end of copying a file. What do you think?