- else
- {
- infostream<<"RecursiveDelete: Deleting content of directory "
- <<path<<std::endl;
- std::vector<DirListNode> content = GetDirListing(path);
- for(size_t i=0; i<content.size(); i++){
- const DirListNode &n = content[i];
- std::string fullpath = path + DIR_DELIM + n.name;
- bool did = RecursiveDelete(fullpath);
- if(!did){
- errorstream<<"RecursiveDelete: Failed to recurse to "
- <<fullpath<<std::endl;
- return false;
- }
- }
- infostream<<"RecursiveDelete: Deleting directory "<<path<<std::endl;
- //bool did = RemoveDirectory(path.c_str();
- bool did = true;
- if(!did){
- errorstream<<"Failed to recursively delete directory "
- <<path<<std::endl;
+ infostream << "RecursiveDelete: Deleting content of directory "
+ << path << std::endl;
+ std::vector<DirListNode> content = GetDirListing(path);
+ for (const DirListNode &n: content) {
+ std::string fullpath = path + DIR_DELIM + n.name;
+ if (!RecursiveDelete(fullpath)) {
+ errorstream << "RecursiveDelete: Failed to recurse to "
+ << fullpath << std::endl;