<div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">A1.</span><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Is there a (clever?) way to achieve the following using a single function call?<div>
<br></div><div>//does chdir </div><div><br></div><div>void fun(){</div><div>...<br> string dir0=getcwd; scope(exit) chdir(dir0); chdir(dir);<div>...</div></div><div>}</div><div><br></div><div>//desired:</div><div><div>
void fun(){</div><div>...<br> chdir_scoped(dir);<div>...</div></div><div>}</div></div><div><div><br></div><div>AST macros should make that easy, but that's not for tomorrow apparently...</div></div><div><br></div><div>
A2.</div><div>Likewise with temp file creation and similar patterns.</div><div><br></div><div>A3.</div></div><div style="font-family:arial,sans-serif;font-size:13px">can we support an optional dir argument in the std.process functions to execute inside a given directory dir (I believe the exec family should support this)</div>
</div>