<div dir="ltr">+1<div>this is a command use case. Further,relying on shell such as  cd subdir && foo is fragile: if it fails, we're not sure whether it's because it couldn't cd to subdir or because of foo. </div>
<div><br></div><div>Woudl the following be as efficient?</div><div>system_in_dir(string dir, string action){</div><div>auto path=getcwd</div><div>scope(exit)</div><div>  chdir(path)</div><div>chdir(dir)</div><div>system(action)</div>
<div>}</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Oct 24, 2013 at 12:43 AM, Benjamin Thaut <span dir="ltr"><<a href="mailto:code@benjamin-thaut.de" target="_blank">code@benjamin-thaut.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Am 24.10.2013 09:06, schrieb simendsjo:<div><div class="h5"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Thursday, 24 October 2013 at 06:25:40 UTC, Benjamin Thaut wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
As far as I can tell std.process can only run commands in the working<br>
directory of the currently executing function. I want to execute a<br>
certain program inside a subdirectory on windows and can't get it to<br>
work:<br>
<br>
myproject<br>
 |- subdir<br>
<br>
So my executable has "myproject" as working directory. And I want to<br>
execute "dmd" with "subdir" as working directory.<br>
</blockquote>
<br>
Isn't it possible to execute a command like "cd subdir && dmd"?<br>
</blockquote>
<br></div></div>
Thanks. That works. It still would be nice if std.process had this in its API.<div class="HOEnZb"><div class="h5"><br>
<br>
-- <br>
Kind Regards<br>
Benjamin Thaut<br>
</div></div></blockquote></div><br></div>