0.1500.3.0 (🗿 edition)

This commit is contained in:
Markus Isberg
2021-09-17 22:47:21 +09:00
parent 1231170fce
commit 5a6bbcc79e
75 changed files with 1145 additions and 441 deletions
@@ -315,7 +315,11 @@ namespace Barotrauma.IO
return System.IO.File.GetLastWriteTime(path);
}
public static FileStream Open(string path, System.IO.FileMode mode, System.IO.FileAccess access = System.IO.FileAccess.ReadWrite)
public static FileStream Open(
string path,
System.IO.FileMode mode,
System.IO.FileAccess access = System.IO.FileAccess.ReadWrite,
System.IO.FileShare? share = null)
{
switch (mode)
{
@@ -331,10 +335,12 @@ namespace Barotrauma.IO
}
break;
}
return new FileStream(path, System.IO.File.Open(path, mode,
access =
!Validation.CanWrite(path, false) ?
System.IO.FileAccess.Read :
access));
access;
var shareVal = share ?? (access == System.IO.FileAccess.Read ? System.IO.FileShare.Read : System.IO.FileShare.None);
return new FileStream(path, System.IO.File.Open(path, mode, access, shareVal));
}
public static FileStream OpenRead(string path)