implementation for remove files

This commit is contained in:
Ari Lazier 2016-01-11 19:27:00 -08:00
parent 2c8696ea57
commit 469121429a
1 changed files with 4 additions and 0 deletions

View File

@ -5,6 +5,7 @@
#include "../platform.hpp" #include "../platform.hpp"
#include "../js_init.h" #include "../js_init.h"
#include <string> #include <string>
#include <stdlib.h>
std::string s_default_realm_directory; std::string s_default_realm_directory;
@ -21,6 +22,9 @@ std::string default_realm_file_directory()
void ensure_directory_exists_for_file(const std::string &fileName) void ensure_directory_exists_for_file(const std::string &fileName)
{ {
std::string cmd = "rm " + s_default_realm_directory + "/*.realm " +
s_default_realm_directory + "/*.realm.lock";
system(cmd.c_str());
} }
void remove_realm_files_from_directory(const std::string &directory) void remove_realm_files_from_directory(const std::string &directory)