There is a file C:\acme.log that another program (not mine) is writing to. It is a log file, so the program always has it open for writing.
I would like to read the current contents of the log file. I tried
FileInfo fInfo = new FileInfo(@"C:\acme.log");
FileStream fileStream = fInfo.Open(FileMode.Open, FileAccess.Read);
This fails with System.IO.IOException: The process cannot access the file 'C:\acme.log' because it is being used by another process.
I can open the file in Notepad and view its contents. If Notepad can open the file, there should be a way for my program to do it, shouldn't there?