问题
I am trying to create a file copy utility which should work as a replacement of the standard windows file copying process. The main reason to do so is to add copy/move queue support and hopefully some sort of optimisation by enabling multiple file transfers only when the file transfers would not involve the same destination physical media(You know how the overall transfer rate drops when there are multiple transfers going on with the same destination media?)
I would like to clarify that I have had almost no real world programming experience. I intend to use C#/.net for the project.
In essence, I intend to create something similar in functionality as teracopy(if not with the same performance gains).
Here are the few things I need expert advice on:
How does the file copy/move speed depend on the storage media(Hard disk, flash drive,etc)?
Read/Write speeds on operations from one hard disk to another.(For example, copying a file from hard disk A to B, from A to A).
What sort of simultaneous copy/move operations would not significantly affect each other, if performed simultaneously(I am not considering the load on the processor or the device controller ... or should I?)?
I do admit I may not have been absolutely clear about the questions, so please let me know if you need more details to be able to provide an answer.
Thank you.
回答1:
I think you can accomplish such a thing in C# using part of the Win Api through external calls. Or maybe there is already an interface for this that I am not aware of (Since I am comparatively new to C# having used it for only 2 months). Personally , however , I would make such a thing in C/C++ using the Windows Api if I want performance, or Python if I want some good features and cross-platform compatibility. Try to find some library that provides cross-platform compatibility and a layer on top of the standard win api functions.
This link may come in helpful: http://msdn.microsoft.com/en-us/library/cc148994.aspx
Also if you are not too worried about cross-platform compatibility there is a shortcut, you can try using OS specific commands like Batch if you use windows which are quite easy, e.g if you want to copy a file named foo from C:\ to D:\ just do "Copy C:\Foo.txt D:\Foo.txt" and you are done, you don't have to worry about USB Drives or Hard Disks, all you need tp know is the directory to copy to. You can access these commands using the "system()" function in C/C++, I don't know of a C Sharp equivelant.
来源:https://stackoverflow.com/questions/4735207/storage-devices-file-transfer-and-copy-operation-logic