remove management directories in node

This commit is contained in:
Ari Lazier 2016-06-20 10:49:53 -07:00
parent a78f2270ae
commit 5eb64025f9
1 changed files with 6 additions and 1 deletions

View File

@ -66,9 +66,14 @@ void remove_realm_files_from_directory(const std::string &dir_path)
while (struct dirent *entry = readdir(dir)) {
if (strstr(entry->d_name, ".realm")) {
// Intentionally not complaining if there was an error.
if (entry->d_type == DT_DIR) {
rmdir(entry->d_name);
}
else {
unlink(entry->d_name);
}
}
}
closedir(dir);
}