I am wondering if it's possible to get a readonly FileStream to a locked file? I now get an exception when I try to read the locked file.
using (FileStream stream = new FileStream("path", FileMode.Open))
Thanks!
You should try another constructor. They are documented at MSDN.
This one looks like a bet:
FileStream Constructor (String, FileMode, FileAccess, FileShare)
FileAccess
A constant that determines how the file can be accessed by the FileStream object. This gets the CanRead and CanWrite properties of the FileStream object. CanSeek is true if path specifies a disk file.
FileShare
A constant that determines how the file will be shared by processes.