the directory to step into
FileException on error.
import std.algorithm.comparison : equal; import std.algorithm.sorting : sort; import std.array : array; import std.path : buildPath; auto cwd = getcwd; auto dir = deleteme ~ "dir"; dir.mkdir; scope(exit) cwd.chdir, dir.rmdirRecurse; dir.buildPath("a").write("."); dir.chdir; // step into dir "b".write("."); assert(dirEntries(".", SpanMode.shallow).array.sort.equal( [".".buildPath("a"), ".".buildPath("b")] ));
Change directory to pathname. Equivalent to cd on Windows and POSIX.