ScopedChdir

Helper struct to change the directory for the current scope.

struct ScopedChdir {
Path prevDir;
}

Constructors

this
this(string newDir)

Convenience overload that takes a string.

Destructor

A destructor is present on this object, but not explicitly documented in the source.

Examples

1 auto orig = cwd();
2 with(ScopedChdir("..")) {
3   assertNotEqual(orig, cwd());
4 }
5 assertEqual(orig, cwd());

Meta