ZoneCodeGenerator: When parsing open files in non-exclusive reading mode so other instances of ZoneCodeGenerator can run at the same time

This commit is contained in:
Jan 2019-09-28 12:02:09 +02:00
parent 63bbcfe5cb
commit 9e516cea1f

View File

@ -44,7 +44,7 @@ namespace ZoneCodeGenerator.Parsing.Impl
public IncludingStreamFileSystem(string path)
{
states = new Stack<HeaderStreamState>();
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);
}