[Issue 20585] New: std.stdio.File open() failure leaves File in invalid state

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Feb 17 08:24:32 UTC 2020


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

          Issue ID: 20585
           Summary: std.stdio.File open() failure leaves File in invalid
                    state
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: turkeyman at gmail.com

Eg:

  File f;
  try
    f.open("doesnt_exist.txt"); //
  catch (Exception e)
  {
    // handle open failure
  }

  assert(f.isOpen == false); // FAIL! f.isOpen == true even though open()
failed

  if (f.isOpen)
    f.close(); // CRASH! file is not actually open


This seems like a problem.

--


More information about the Digitalmars-d-bugs mailing list