How would I retrieve the stdout error message of a system/shell command?

Andrej Mitrovic andrej.mitrovich at gmail.com
Thu Sep 8 08:33:49 PDT 2011


E.g.:

import std.process;

void main()
{
    auto res = shell("dmd bla.d");
}

where bla.d doesn't exist. This will throw an exception, but even if I
caught the exception I will still loose the error message. Is there
any way I could grab the error message? In this case it would be:

"std.exception.ErrnoException at std\process.d(356):  (No error)"

Okay that's a pretty useless error as it is, but other errors might be
more informative and I'd like to grab them.


More information about the Digitalmars-d-learn mailing list