We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug Reading a DataStream from a readonly file throws a UnauthorizedAccessException.
DataStream
UnauthorizedAccessException
Seems to happen only in Windows.
To Reproduce
string tempFile = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); File.WriteAllBytes(tempFile, new byte[] { 0xCA, 0xFE, 0x00, 0xFF }); File.SetAttributes(tempFile, FileAttributes.ReadOnly); Node node = NodeFactory.FromFile(tempFile); byte[] buffer = new byte[4]; _ = node.Stream.Read(buffer, 0, 4); node.Dispose(); File.SetAttributes(tempFile, FileAttributes.Normal); File.Delete(tempFile);
Expected behavior It should read the file contents.
Exceptions
Message: System.UnauthorizedAccessException : Access to the path 'C:\Users\<removed>\AppData\Local\Temp\ojuirizr.zau' is denied. Stack Trace: FileStream.ValidateFileHandle(SafeFileHandle fileHandle) FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options) FileStream.ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) FileStream.ctor(String path, FileMode mode, FileAccess access) LazyFileStream.Initialize() line 145 LazyFileStream.Read(Byte[] buffer, Int32 index, Int32 count) line 86 DataStream.Read(Byte[] buffer, Int32 offset, Int32 count) line 475 NodeFactoryTests.ReadFromReadonlyFile() line 616
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Describe the bug
Reading a
DataStream
from a readonly file throws aUnauthorizedAccessException
.Seems to happen only in Windows.
To Reproduce
Expected behavior
It should read the file contents.
Exceptions
The text was updated successfully, but these errors were encountered: