Thread overview |
---|
April 17, 2020 Working with cmd | ||||
---|---|---|---|---|
| ||||
Are there any libs which can be used to access cmd commands? |
April 18, 2020 Re: Working with cmd | ||||
---|---|---|---|---|
| ||||
Posted in reply to Quantium | On Friday, 17 April 2020 at 21:38:23 UTC, Quantium wrote: > Are there any libs which can be used to access cmd commands? std.process https://dlang.org/phobos/std_process.html#.execute |
April 18, 2020 Re: Working with cmd | ||||
---|---|---|---|---|
| ||||
Posted in reply to Quantium | On Friday, 17 April 2020 at 21:38:23 UTC, Quantium wrote:
> Are there any libs which can be used to access cmd commands?
You can pipe cmd.exe:
---
import std.process : pipeProcess, ProcessPipes;
ProcessPipes pp = pipeProcess(["cmd.exe"]);
pp.stdin.writeln("echo foobar");
pp.stdin.close;
assert(pp.stdout.readln() == "foobar\n");
---
there are other ways depending on what you really want to do.
|
Copyright © 1999-2021 by the D Language Foundation