rmdirRecurse

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

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

Parameters

de DirEntry

The DirEntry to 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