Skip to content

Commit

Permalink
* Explicitly specifying FileShare.Read option when opening the file s…
Browse files Browse the repository at this point in the history
…tream (#72)

Co-authored-by: Michal Linhart <[email protected]>
  • Loading branch information
zoka-cz and zoka-ml authored Oct 21, 2024
1 parent 51f46d2 commit 83558ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/NReco.Logging.File/FileLoggerProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ void createLogFileStream(bool append) {
// so there is no need for a "manual" check first.
fileInfo.Directory.Create();

LogFileStream = new FileStream(LogFileName, FileMode.OpenOrCreate, FileAccess.Write);
LogFileStream = new FileStream(LogFileName, FileMode.OpenOrCreate, FileAccess.Write, FileShare.Read);
if (append) {
LogFileStream.Seek(0, SeekOrigin.End);
} else {
Expand Down

0 comments on commit 83558ad

Please sign in to comment.