On Wednesday, 28 August 2019 at 12:19:54 UTC, Andre Pany wrote:
Hi,

I call another process using function pipeShell and Redirect.all.


import std;

void main()
{
    auto p = pipeShell("a.exe", Redirect.all);
    p.stdin.writeln("e1");
    p.stdin.writeln("10");
    p.stdin.writeln("e2");
    p.stdin.writeln("9");

    p.stdin.flush();
    p.stdout.readln.writeln;

    import core.thread: Thread;
    import core.time: seconds;

    Thread.sleep(2.seconds);
    p.stdin.close;
    p.stderr.byLineCopy.writeln;
    Thread.sleep(1.seconds);
    try {
        p.pid.kill; // Windows exception here "Access denied"
        p.pid.wait; // but no more MessageBox
    } catch (Throwable) { }
}

Reply via email to