Hi,
Any reason why the following wont work?

void main(string[] args)
{
    auto pidIn = File.tmpfile();
    auto pidOut = File.tmpfile();
auto pid = spawnProcess(["ls", "./"], pidIn, pidOut, std.stdio.stdout, null, Config.newEnv);

    if(wait(pid) == 0)
        writefln("%s", pidOut.readln());
}

The pidOut.readln() throws this exception:
object.Exception@/usr/include/dmd/phobos/std/stdio.d(1377): Attempt to read from an unopened file.

I figured tmpfile() would be open for read/write by default?
Also, theres no way to pass in args to File.tmpfile() to make them read/write.

Any ideas?

Reply via email to