The OpenD Programming Language

rmdirRecurse

Remove directory and all of its content and subdirectories, recursively.

  1. void rmdirRecurse(const(char)[] pathname)
    @safe
    void
    rmdirRecurse
    (
    scope const(char)[] pathname
    )
  2. void rmdirRecurse(DirEntry de)
  3. void rmdirRecurse(DirEntry de)

Parameters

pathname const(char)[]

the path of the directory to completely remove

Throws

FileException if there is an error (including if the given file is not a directory).

Examples

import std.path : buildPath;

auto dir = deleteme.buildPath("a", "b", "c");

dir.mkdirRecurse;
assert(dir.exists);

deleteme.rmdirRecurse;
assert(!dir.exists);
assert(!deleteme.exists);

Meta