<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Aug 12, 2014 at 11:09 PM, Lars T. Kyllingstad via Digitalmars-d <span dir="ltr"><<a href="mailto:digitalmars-d@puremagic.com" target="_blank">digitalmars-d@puremagic.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On Tuesday, 12 August 2014 at 07:53:44 UTC, Timothee Cour via Digitalmars-d wrote:<br>
</div><div class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The deprecation message in 2.066(rc): 'Deprecation: function<br>
std.process.system is deprecated - Please use executeShell instead' is<br>
often not what user wants.<br>
</blockquote>
<br></div>
Wait, what?  The pull request that deprecated system() was only merged a few days ago!  How can it already be in a release candidate?  I thought that once the beta cycle started only bug fixes would be incorporated.  Deprecations are breaking changes!<br>
</blockquote><div><br></div><div>clarification: actually that was from git master, not from rc.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
But anyway, I agree that the deprecation message is somewhat off the mark.  The expression that most closely matches system(cmd) is wait(spawnShell(cmd)).<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">
The behavior of the deprecated std.process should most closely be:<br>
<br></div><div class="">
int systemNew(in char[] args){<br>
auto pipes = pipeShell(args, cast(Redirect)0);<br>
return wait(pipes.pid);<br>
}<br>
<br></div><div class="">
which could be a function in std.process if we deprecate std.process.system<br>
(possibly with a few extra parameters such as environment etc).<br>
</div></blockquote>
<br>
No, there is no point in using pipeShell() if you're not redirecting the streams.  Then you should use spawnShell().  pipeXyz() is just spawnXyz() plus automatic pipe creation.<br>
<br>
wait(spawnShell(cmd)) is simple enough that I don't think it needs to be a separate function in std.process.<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">
Indeed, system doesn't capture output (which could potentially require lots<br></div>
of memory) [...]<br>
</blockquote>
<br>
Note that you can set executeShell's maxOutput parameter to zero, in which case it will not collect any output and thus not consume any memory.  But it still swallows the output, which you are right that system() does not.<br>

<br>
I will submit a pull request that changes the deprecation message.  Thanks for pointing it out!<br>
<br>
Lars<br>
</blockquote></div><br></div></div>