deprecation message std.process.system=>executeShell often not what's needed

Vladimir Panteleev via Digitalmars-d digitalmars-d at puremagic.com
Tue Aug 12 15:41:31 PDT 2014


On Tuesday, 12 August 2014 at 07:53:44 UTC, Timothee Cour via 
Digitalmars-d wrote:
> int systemNew(in char[] args){
> auto pipes = pipeShell(args, cast(Redirect)0);
> return wait(pipes.pid);
> }

Why use pipeShell instead of spawnShell? And why 
`cast(Redirect)0`? It's not necessary. Also note that shell 
commands (incl. system) take one string argument, not an array.

This can be a simpler one-liner: wait(executeShell(cmd))

So, the deprecation message is not far off, perhaps missing a 
`.wait()`.

> Indeed, system [..] doesn't wait until completion, unlike 
> executeShell.

You mean it does wait until completion?


More information about the Digitalmars-d mailing list