Bug 20585 – std.stdio.File open() failure leaves File in invalid state
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-02-17T08:24:32Z
Last change time
2020-02-18T00:32:18Z
Keywords
pull
Assigned to
No Owner
Creator
Manu
Comments
Comment #0 by turkeyman — 2020-02-17T08:24:32Z
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.
Comment #1 by dlang-bot — 2020-02-17T15:51:44Z
@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
Comment #2 by dlang-bot — 2020-02-18T00:32:18Z
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