I'm reading a file which is periodically being written to by a 3rd party program. Im reading using the below FileStream:
using (FileStream fs = new FileStream(
FullPath,
FileMode.Open,
FileAccess.Read,
FileShare.ReadWrite))
However the 3rd party program is writing to the file but is using the FileShare.None
So occasionally I've got the file open for reading when the 3rd party program tries to open the file with exclusive access but fails.
How can I read this file without causing problems for the 3rd party program? I wouldn't mind releasing my read to give priority to another application. Any way to do this?