Browse Source

waste less time in mkdirp

master
Martin Dørum 3 years ago
parent
commit
287078ff30
1 changed files with 6 additions and 0 deletions
  1. 6
    0
      src/sys.cc

+ 6
- 0
src/sys.cc View File

@@ -11,6 +11,7 @@
#include <sys/wait.h>
#include <stdexcept>
#include <system_error>
#include <unordered_set>

#include "logger.h"
#include "globals.h"
@@ -45,6 +46,11 @@ bool fileExists(const std::string &path) {
}

void mkdirp(const std::string &path) {
static thread_local std::unordered_set<std::string> set;
auto res = set.emplace(path);
if (!res.second)
return;

// TODO: Implement this in C++ instead
std::vector<std::string> argv;
argv.push_back("mkdir");

Loading…
Cancel
Save