std.process
有一个很好的shell()
功能。
import std.process;
import std.stdio;
void main()
{
string Output = shell("ls .");
writeln("The contents of this directory are:");
write(Output);
}
它记录在 Phobos 源中,但不是在线的。这让我在实际代码中使用它有点犹豫。它是实验性的和不稳定的,还是在线文档只是落后了?