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

Timothee Cour via Digitalmars-d digitalmars-d at puremagic.com
Tue Aug 12 00:53:33 PDT 2014


The deprecation message in 2.066(rc): 'Deprecation: function
std.process.system is deprecated - Please use executeShell instead' is
often not what user wants.

The behavior of the deprecated std.process should most closely be:

int systemNew(in char[] args){
auto pipes = pipeShell(args, cast(Redirect)0);
return wait(pipes.pid);
}

which could be a function in std.process if we deprecate std.process.system
(possibly with a few extra parameters such as environment etc).

Indeed, system doesn't capture output (which could potentially require lots
of memory), and doesn't wait until completion, unlike executeShell.
To make a user's code upgrade from std.process, he most likely will want
something like systemNew instead.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20140812/c732e8e9/attachment.html>


More information about the Digitalmars-d mailing list