diff --git a/src/node/platform.cpp b/src/node/platform.cpp index 6d355cc2..3915e87e 100644 --- a/src/node/platform.cpp +++ b/src/node/platform.cpp @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include @@ -58,19 +58,8 @@ void copy_bundled_realm_files() void remove_realm_files_from_directory(const std::string &dir_path) { - DIR *dir = opendir(dir_path.c_str()); - if (!dir) { - return; - } - - while (struct dirent *entry = readdir(dir)) { - if (strstr(entry->d_name, ".realm")) { - // Intentionally not complaining if there was an error. - unlink(entry->d_name); - } - } - - closedir(dir); + std::string delete_realms = "rm -rf '" + dir_path + "'/*.realm*"; + system(delete_realms.c_str()); } } // realm