www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10395] New: [std.stdio] Closing a popened File with unread output throws an exception

http://d.puremagic.com/issues/show_bug.cgi?id=10395

           Summary: [std.stdio] Closing a popened File with unread output
                    throws an exception
           Product: D
           Version: D2
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: code dawg.eu


--- Comment #0 from Martin Nowak <code dawg.eu> 2013-06-17 15:29:58 PDT ---
cat > bug.d << CODE
import std.stdio;

void main(string[] args)
{
    File file;
    file.popen("echo foobar");
    file.close();
}
CODE

dmd -run bug

------
std.exception.ErrnoException std/stdio.d(480): Command returned 13 (Success)
------

I don't know why pclose returns 13.

NB:
The error message is wrong too. It should be EINVAL (13) not Success (0).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 17 2013