I want to copy some text files, that are written by another app, but I don't want to do anything to prevent the other app. from writing to these files.
I am using File.Copy
, from the System.IO namespace
, C#, .Net Framework 2.0.
I checked MSDN's documentation, but nothing is specifically stated about the method that File.Copy
uses. Is it a wrapper to an unmanaged API call?
Does File.Copy
lock, or block the file being copied in any way?
Thanks in advance for any info about this.
If the other app creates its files by specifying FileShare.None, you will receive an UnauthorizedAccessException. So I imagine that you just have to process this specific exception in your app.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With