From 9e516cea1f0caa43e2d2389facb4a517419abdec Mon Sep 17 00:00:00 2001 From: Jan Date: Sat, 28 Sep 2019 12:02:09 +0200 Subject: [PATCH] ZoneCodeGenerator: When parsing open files in non-exclusive reading mode so other instances of ZoneCodeGenerator can run at the same time --- .../Parsing/Impl/IncludingStreamFileSystem.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ZoneCodeGenerator/Parsing/Impl/IncludingStreamFileSystem.cs b/src/ZoneCodeGenerator/Parsing/Impl/IncludingStreamFileSystem.cs index c6ab2548..392262b2 100644 --- a/src/ZoneCodeGenerator/Parsing/Impl/IncludingStreamFileSystem.cs +++ b/src/ZoneCodeGenerator/Parsing/Impl/IncludingStreamFileSystem.cs @@ -44,7 +44,7 @@ namespace ZoneCodeGenerator.Parsing.Impl public IncludingStreamFileSystem(string path) { states = new Stack(); - var initialState = new HeaderStreamState(new FileStream(path, FileMode.Open), path); + var initialState = new HeaderStreamState(new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read), path); states.Push(initialState); } @@ -86,7 +86,7 @@ namespace ZoneCodeGenerator.Parsing.Impl if (!File.Exists(path)) return; - var newState = new HeaderStreamState(new FileStream(path, FileMode.Open), path); + var newState = new HeaderStreamState(new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read), path); states.Push(newState); }