|
-
May 31st, 2008, 11:47 AM
#1
estimating time for moving files
i have a program that can move files from one directory to another using the io.moveto function. these files are usually quite large (300MB+ videos). i was wondering if anyone knew how to show the progress of the copy in my form ie state how many bytes have been copied in a label and update it as the file is being copied. even better would be to know the transfer rate so i could estimate a time remaining. i know how to get the total size of the file
-
May 31st, 2008, 12:22 PM
#2
Re: estimating time for moving files
it would also be helpful if anyone knew how to cancel a move midway through as once i call the io.moveto function the program can't do anything else until it is finished
-
May 31st, 2008, 01:44 PM
#3
Re: estimating time for moving files
Here is a nice read for you.
http://msdn.microsoft.com/en-us/library/y32kbeb6.aspx
You can use My.Computer.FileSystem.MoveFile method. This method has an overload which lets you show the Copy Dialog and also lets you cancel the operation.
-
June 2nd, 2008, 10:55 AM
#4
Re: estimating time for moving files
 Originally Posted by johntheface
i have a program that can move files from one directory to another using the io.moveto function. these files are usually quite large (300MB+ videos). i was wondering if anyone knew how to show the progress of the copy in my form ie state how many bytes have been copied in a label and update it as the file is being copied. even better would be to know the transfer rate so i could estimate a time remaining. i know how to get the total size of the file
You can add a timer control to request periodically the size of the already copied file. Windows changes the size of the destiny path file meanwhile copying it.
You can estimate the remaining time as being a constant proportional to the number of files, more another constant proportional to the remaining total added size of files.
Although you cannot predict delays caused by other program system calls, or hard disk fragmentation.
_
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|