pushd / popd for std.process/std.file

David d at dav1d.de
Tue Jul 9 07:21:47 PDT 2013


Having pushd/popd in std.process would make a lot of code look better,
often you have to change the workding directory only for a few commands,
with pushd/popd you don't have to temporarily store the old one explicitly.

pushd/popd: https://en.wikipedia.org/wiki/Pushd_and_popd

What do you think?


void build() {
    pushd("../build")
    scope(exit) popd();

    shell("cmake ../src/c/bla");
    shell("make");
}



More information about the Digitalmars-d mailing list