Simple delete directory tree?

Nick Sabalausky SeeWebsiteToContactMe at semitwist.com
Fri Apr 26 14:25:58 PDT 2013


On Fri, 26 Apr 2013 17:01:43 -0400
Nick Sabalausky <SeeWebsiteToContactMe at semitwist.com> wrote:

> On Fri, 26 Apr 2013 22:55:36 +0200
> "Andrej Mitrovic" <andrej.mitrovich at gmail.com> wrote:
> 
> > On Friday, 26 April 2013 at 20:54:41 UTC, Nick Sabalausky wrote:
> > > Does phobos have a simple way to delete a directory tree?
> > > std.file.rmdir(path) and std.file.remove(path) don't seem to do 
> > > it.
> > 
> > Try rmdirRecurse
> 
> I don't know how I managed to overlook that! Thanks :)
> 
> Unfortunately, that's still choking with "Access is denied" on
> something inside a ".git" subdirectory.
> 

FWIW, This seems to work fine, at least on windows:

import std.process;
version(Windows)
    system(`rmdir /S /Q "`~path~`"`);
else
    system(`rm -rf '`~path~`'`);



More information about the Digitalmars-d-learn mailing list