none
Estimate how long a file will take to copy RRS feed

  • Question

  • Hi Everyone:

    I am using VB.net 2015, and I am trying to copy about 40,000 files that are roughly 1.2 GB, using the File.copy method.  Now I have two questions:

    1- does anyone know if I use the CopyFileA API function, would the time it takes to copy the files decrease or stay relatively the same as File.copy

    2- I looked on the forums and the internet to see if there is a relatively good way to estimate how long it will take to copy the files (similar to what you get when you try to copy the files in windows explorer), but the majority of places I looked said that is was a waste of time.  So, I was wondering if anyone has any new ideas.  If so, I would appreciate a sample code.

    I appreciate all your help.

    Bob

    Friday, January 18, 2019 8:47 PM

All replies

  • Hello,

    The following is in C# yet it still may be worth looking into for a different (and not simple) path to follow.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Friday, January 18, 2019 9:28 PM
    Moderator
  • You can do like Explorer (IFileOperation or, simpler, SHFileOperation)
    Friday, January 18, 2019 9:59 PM
  • I don't think this answers either of my questions.  thank you though.
    Friday, January 18, 2019 11:57 PM
  • Thanks Karen.  I had actually seen that before, and in several websites that they refer to it, people had mentioned that it is not very accurate, and not worth the effort.  That is why, I decided to post here.  Thanks for your help.  If I do not find any thing else, I will try it and see for myself.  Thanks.
    Friday, January 18, 2019 11:58 PM
  • SHFileOperation will display the time it will take
    Saturday, January 19, 2019 12:31 AM
  • Hi,

    Do you resolve the issue? If you resolve the issue,please mark the helpful as answer.If the problem is not solved,see the following link:

    https://stackoverflow.com/questions/36956296/issue-correctly-calculating-time-remaining-on-file-copy

    Best Regards,

    Alex


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, January 21, 2019 7:13 AM