OpenWrite doesn't prevent writing #1156
Labels
state: needs discussion
Issues that need further discussion
type: bug
Issues that describe misbehaving functionality
Describe the bug
Stream.CopyTpAsync still works with a write only stream.
To Reproduce
var fs = new MockFileSystem();
...
using var estream = entry.Open();
using var fstream = file.OpenWrite();
var temp = fstream.CanRead; // false
await fstream.CopyToAsync(estream);
Expected behavior
MockFileSystem and FileSystem would behave the same.
Additional context
I'm writing into a ZipArchive but that shouldn't matter.
Swapping to use FileSystem in the Unit test does throw a permissions exception.
The text was updated successfully, but these errors were encountered: