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.
@kubo39 created dlang/phobos pull request #7397 "Fix Issue 20585 - std.stdio.File.open() failure leaves File in invalid" fixing this issue: - Fix Issue 20585 - std.stdio.File.open() failure leaves File in invalid state https://github.com/dlang/phobos/pull/7397
dlang/phobos pull request #7397 "Fix Issue 20585 - std.stdio.File.open() failure leaves File in invalid" was merged into stable: - 902e49bb66071e97c9f413251d2672ce32a05341 by Hiroki Noda: Fix Issue 20585 - std.stdio.File.open() failure leaves File in invalid state https://github.com/dlang/phobos/pull/7397