I think the best way is to iterate over inside the folder and execute remove_all for each item. Code example:
namespace fs=boost::filesystem; fs::path path_to_remove("C:\\DirectoryToRemove"); for (fs::directory_iterator end_dir_it, it(path_to_remove); it!=end_dir_it; ++it) { fs::remove_all(it->path()); }
J. calleja
source share