You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MockFileSystem.File.Create(string) returns a stream with CanRead false #801
MockFileStream, when returned as a result of a MockFileSystem.File.Create(string path) call, incorrectly has CanRead set to false.
This is different than System.IO.File.Create(string path), which correctly sets CanRead to true.
CanRead being false, can result in problems when used with code that expects true, for example, new BinaryReader(Stream stream), which checks the CanRead property in it's ctor, and throws when not true.
Activity
pianomanjh commentedon Feb 1, 2022
this was regressed by #714
pianomanjh commentedon Feb 1, 2022
workaround until fix is merged is to use File.Open, i.e.:
_fileSystem.File.Open(filePath, FileMode.Create, FileAccess.ReadWrite)fix: initialize streams returned by MockFile.Create with ReadWrite ac…
github-actions commentedon Feb 2, 2022
This is addressed in release v16.1.8.