Suppose I’m writing a very long string to a file using File.WriteAllText, and another thread or process is trying to read the same file. Would it throw any exception? In other words, what is the FileShare parameter that the File.WriteAllText method uses? It’s not written in the documentation!
Suppose I’m writing a very long string to a file using File.WriteAllText, and another
Share
This is the source code from .net Framework 4.0. clearly StreamWriter is used that Uses FileShare.Read Internally.
This is the code that creates the underlying stream for StreamWriter.