Click here to Skip to main content
15,880,469 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am Transfer one directory from system to pendrive (Regular 2.0 USB Device) with the help of Microsoft.VisualBasic.FileIO.FileSystem.CopyDirectory class but it is taking too much time for transfer directory.
Size of directory is 12GB or some time more then 12GB.

12GB directory taking time 2hrs.

So, I want to apply proper solution or algorithm to transfer directory fast as well as I want to apply progress bar too.

Let me know if any other solution to make faster copy using C#

Note :
1. Client do not want to use USB 3.0 pendrive device.
2. Client do not want to use any special hardware for faster copy purpose.

Thanking you in advance

What I have tried:

I have already tried following solutions

1. XCopy Command with Command Propmpt using Process Class
2. Power shell Command with Power shell Command Propmpt using Process Class
3. CopyToAsync method of Task class (Threading) (Progressbar or Seek is not working because of Async Type of Copy)
4. Parallel Foreach loop in C#
Posted
Updated 1-Jul-19 0:52am

1 solution

There is no "fast copy" method that will guarantee to make a significant improvement in transfer speed, you are almost certainly limited by three factors:
1) USB transfer speed - this will depend on the version of USB for both the port on the computer and the version of USB in the pendrive - the lowest version of the two controls the USB speed. USB1 had a maximum transfer rate of 12Mbits per second, or about 1.2 Mbytes per second; USB 2 took that to a maximum of 480Mbits per second - but you may not achieve that maximum or even anywhere near it depending on the quality of your kit and drivers.
2) Pen drive write speed: I've seen some older / cheaper ones that struggle to keep up with USB1!
3) Size of files: more small files will take longer to transfer (and probably will take more space) than the same nGB of fewer large files.

There is no magic bullet here: you have bottlenecks and you need to identify them - there is no software algorithm that can vastly improve the transfer time.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900