I found out that the redirect was not responsible for the CPU time, it was some other code part which was responsible for it and totally unrelated to the redirect.

I also saw that a redirect in my case is much simpler by using spawnProcess:

auto logFile = File("errors.log", "w");
auto pid = spawnProcess(["dmd", "myprog.d"],
                        std.stdio.stdin,
                        std.stdio.stdout,
                        logFile);

Reply via email to