digitalmars.D.learn - Problem with escaping commands in spawProcess().
- Cooler (15/15) Mar 07 2014 import std.process;
- Andrej Mitrovic (3/9) Apr 13 2014 I'm not sure, but maybe file a bug so this gets some attention:
import std.process;
int main(string[]){
// Next line will generate error message from cmd.exe
spawnProcess(["cmd.exe", "/C", "echo"]).wait();
return 0;
}
Running the code above will result in windows shell error
message. As I understand the error is due to escaping all
arguments in std.process.spawnProcess function.
int main(string[]){
spawnShell("cmd.exe /C echo").wait(); // Works fine
return 0;
}
Is there any way to run the code with spawnProcess instead of
spawnShell?
Mar 07 2014
On Friday, 7 March 2014 at 09:26:27 UTC, Cooler wrote:
import std.process;
int main(string[]){
// Next line will generate error message from cmd.exe
spawnProcess(["cmd.exe", "/C", "echo"]).wait();
return 0;
}
I'm not sure, but maybe file a bug so this gets some attention:
https://issues.dlang.org/enter_bug.cgi?product=D
Apr 13 2014








"Andrej Mitrovic" <andrej.mitrovich gmail.com>