www.digitalmars.com         C & C++   DMDScript  

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


          Issue ID: 18987
           Summary: Reading from unreadable file produces incorrect
           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"

import std.stdio;

void main()
    auto x = File("hi", "w");
    ubyte[100] 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