Method CopyToUsingStreams
CopyToUsingStreams(FileSystemInfo, string, bool, int)
Copies the current file to the specified destination using managed streams (no native File.Copy or CopyFile). Reason why this method exists is due to problem in virtualization - Kernel32.CopyFile does not properly work
Declaration
public static void CopyToUsingStreams(this FileSystemInfo source, string destinationPath, bool overwrite = false, int bufferSize = 81920)
Parameters
Type | Name | Description |
---|---|---|
FileSystemInfo | source | The source file (must be a FileInfo). |
string | destinationPath | Full destination file path. |
bool | overwrite | Whether to overwrite the file if it already exists. |
int | bufferSize | The size of the buffer for the copy operation. |