www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20585] New: std.stdio.File open() failure leaves File in

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 puremagic.com
          Reporter: turkeyman 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.

--
Feb 17