Reputation: 3636
I'm looking into ways to possibly improve file transfer speeds to a network drive. I'm currently using the standard File.Copy. Does anyone know the default buffer size for File.Copy and if it's possible to change it?
Upvotes: 0
Views: 406
Reputation: 32053
Given that File.Copy
uses Window's copy functions, as you can see in the source code:
internal const String KERNEL32 = "kernel32.dll";
[DllImport(KERNEL32, SetLastError=true, CharSet=CharSet.Auto, BestFitMapping=false)]
[ResourceExposure(ResourceScope.Machine)]
internal static extern bool CopyFile(...)
...
bool r = Win32Native.CopyFile(fullSourceFileName, fullDestFileName, !overwrite);
There's not a lot (in fact, nothing) you can do to optimize this.
Upvotes: 3