|
|
@@ -18,6 +18,8 @@ |
|
|
|
|
|
|
|
namespace sys { |
|
|
|
|
|
|
|
static thread_local std::unordered_set<std::string> mkdirp_set; |
|
|
|
|
|
|
|
FileInfo fileInfo(const std::string &path) { |
|
|
|
FileInfo finfo; |
|
|
|
|
|
|
@@ -46,8 +48,7 @@ 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); |
|
|
|
auto res = mkdirp_set.emplace(path); |
|
|
|
if (!res.second) |
|
|
|
return; |
|
|
|
|
|
|
@@ -61,6 +62,7 @@ void mkdirp(const std::string &path) { |
|
|
|
} |
|
|
|
|
|
|
|
void rmrf(const std::string &path) { |
|
|
|
mkdirp_set.erase(path); |
|
|
|
// TODO: Implement this in C++ instead |
|
|
|
std::vector<std::string> argv; |
|
|
|
argv.push_back("rm"); |