Browse Source

std_utils.cc - hopefully improve path_ensure_not_existing/dir_recreate

LIB-11
heck 4 years ago
parent
commit
44b0c23161
  1. 8
      src/std_utils.cc

8
src/std_utils.cc

@ -121,7 +121,7 @@ namespace pEp {
void path_ensure_not_existing(const string &path) void path_ensure_not_existing(const string &path)
{ {
while (path_exists(path)) { while (path_exists(path)) {
path_delete(path); path_delete_all(path);
} }
} }
@ -143,10 +143,8 @@ namespace pEp {
void dir_recreate(const std::string &path) void dir_recreate(const std::string &path)
{ {
if (Utils::path_exists(path)) { Utils::path_ensure_not_existing(path);
Utils::path_delete_all(path); Utils::dir_ensure(path);
}
Utils::dir_create(path);
} }
vector<string> dir_list_all(const std::string &path, const bool incl_dot_and_dotdot) vector<string> dir_list_all(const std::string &path, const bool incl_dot_and_dotdot)

Loading…
Cancel
Save