Boost logo

Boost Users :

From: Scott McMurray (me22.ca+boost_at_[hidden])
Date: 2008-09-01 12:38:24


On Mon, Sep 1, 2008 at 12:05, Ákos Maróy <akos_at_[hidden]> wrote:
> Is there an easy / elegant way to remove directory contents recursively
> using boost::filesystem? I see that there's a create_directories()
> convenience function, but there's no such convenience function for removing
> a directory and all its contents.
>
> moreover, recursive_directory_iterator() does not return an iterator that
> contains the directory contens in the order suitable for removal :(
>
> I wonder if there's an easy / elegant way to do this?
>

Seems there's a remove_all in the operations:
http://www.boost.org/doc/libs/1_36_0/libs/filesystem/doc/reference.html#Operations-functions

I seems like it should be classified as a convenience function,
though, since it appears to be implemented entirely in terms of other
boost.filesystem features and does seem the same sort of thing as
create_directories...

HTH,
~ Scott


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net