3

std.process has a nice shell() function.

import std.process;
import std.stdio;

void main()
{
    string Output = shell("ls .");
    writeln("The contents of this directory are:");
    write(Output);
}

It is documented in the Phobos source, but not online. This makes me a little hesitant to use it in real code. Is it experimental and unstable, or are the online docs just falling behind?

Maxpm
  • 24,113
  • 33
  • 111
  • 170

1 Answers1

5

The problem is the documentation generation. You can safely use that function, it's not going away.

I'll file this bug.

Andrej Mitrović
  • 3,322
  • 3
  • 20
  • 33