I have an application that must check a folder and read any files that are copied into it. How do I test if a file in that folder is currently being written to? I only want
When you open it with System.IO.File.OpenWrite(filename), it should throw IOException.
System.IO.File.OpenWrite(filename)
IOException
So, in a try catch, the code being executed in the catch block should tell you the file was open.