I intend to copy a file over LAN, while it is being created. Lets say a 500MB file is being written using StreamWriter. Can we do copy the file once every 100MB has been written.
What feature of the framework C# async, or LINQ.Parallel .. Can help me to achieve this.
This can be acheived with what’s known as a tee stream. EchoStream looks like it would do the trick. Set up your StreamWriter to write to the EchoStream and have that write to both a NetworkStream and a FileStream, or 2 FileStreams (or whatever).