scoped chdir and similar patterns

Timothee Cour thelastmammoth at
Wed Dec 4 17:07:03 PST 2013


Is there a (clever?) way to achieve the following using a single function

//does chdir

void fun(){
  string dir0=getcwd;  scope(exit) chdir(dir0);  chdir(dir);

void fun(){

AST macros should make that easy, but that's not for tomorrow apparently...

Likewise with temp file creation and similar patterns.

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)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Digitalmars-d-learn mailing list