February 17, 2020 [Issue 20585] New: std.stdio.File open() failure leaves File in invalid state | ||||
|---|---|---|---|---|
| ||||
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. -- | ||||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply