www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18987] New: Reading from unreadable file produces incorrect

https://issues.dlang.org/show_bug.cgi?id=18987

          Issue ID: 18987
           Summary: Reading from unreadable file produces incorrect
                    exception
           Product: D
           Version: D2
          Hardware: All
                OS: Windows
            Status: NEW
          Severity: minor
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: elpenguino+D gmail.com

Attempting to read from a file opened only for writing on Windows (10, build
17134, 64-bit) results in at least one ErrnoException carrying a "No error"
message.


Example:
```
import std.stdio;

void main()
{
    auto x = File("hi", "w");
    ubyte[100] buf;
    x.rawRead(buf);
}
```

results in one "No error" ErrnoException when compiled with -m64 and
-m32mscoff, and two when compiled with -m32. The second one is thrown upon
closing the file.

--
Jun 14 2018