D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4127 - std.stdio.File doesn't close popen() files correctly
Summary: std.stdio.File doesn't close popen() files correctly
Status: RESOLVED DUPLICATE of issue 3157
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: Other Linux
: P2 minor
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-24 17:56 UTC by Adam D. Ruppe
Modified: 2014-02-15 02:46 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Adam D. Ruppe 2010-04-24 17:56:02 UTC
{
    File f;
    f.popen("command", "w");
    f.write("hello world");
}

This throws in its destructor "cannot close file (success)". It looks like File always calls fclose() on its handle, but if it is opened with popen(), it should call pclose() to close it instead.
Comment 1 Lars T. Kyllingstad 2010-04-26 00:14:41 UTC

*** This issue has been marked as a duplicate of issue 3157 ***