How to copy a file over the network that is in frequent use?

Viewed 1386

I need to copy a large file (around 20 MB) over the network. Normally, this wouldn't be an issue, however, the file is written to fairly often (around once a second) by an application that's on the same box as the file.

So because the file is written to pretty often, File.Copy call fails pretty often. I've also tried File.ReadAllLines which seems to work every time, but takes forever.

Is there a better, more efficient and safer way to copy the file over the network?

P.S. The file is being written to by a process that utilizes Log4Net. And, in case anyone is wondering, the process that does the writing is out of my hands.

7 Answers
Related