Lines Matching refs:path
36 Result<void> CleanPriorFiles(const std::string& path, in CleanPriorFiles() argument
38 if (preserving.count(cpp_basename(path))) { in CleanPriorFiles()
39 LOG(DEBUG) << "Preserving: " << path; in CleanPriorFiles()
43 if (lstat(path.c_str(), &statbuf) < 0) { in CleanPriorFiles()
48 return CF_ERRNO("Could not stat \"" << path); in CleanPriorFiles()
52 LOG(DEBUG) << "Deleting: " << path; in CleanPriorFiles()
53 if (unlink(path.c_str()) < 0) { in CleanPriorFiles()
54 return CF_ERRNO("Could not unlink \"" << path << "\""); in CleanPriorFiles()
58 std::unique_ptr<DIR, int(*)(DIR*)> dir(opendir(path.c_str()), closedir); in CleanPriorFiles()
60 return CF_ERRNO("Could not clean \"" << path << "\""); in CleanPriorFiles()
67 std::string entity_path = path + "/" + entity_name; in CleanPriorFiles()
70 << path << "\" failed on recursing into \"" << entity_path in CleanPriorFiles()
73 if (rmdir(path.c_str()) < 0) { in CleanPriorFiles()
76 return CF_ERRNO("Could not rmdir \"" << path << "\""); in CleanPriorFiles()
86 for (const auto& path : paths) { in CleanPriorFiles() local
88 if (stat(path.c_str(), &statbuf) < 0) { in CleanPriorFiles()
92 return CF_ERRNO("Could not stat \"" << path << "\""); in CleanPriorFiles()
95 (is_directory ? prior_dirs : prior_files).emplace_back(path); in CleanPriorFiles()
124 for (const auto& path : paths) { in CleanPriorFiles() local
125 CF_EXPECT(CleanPriorFiles(path, preserving), in CleanPriorFiles()
126 "CleanPriorFiles failed for \"" << path << "\""); in CleanPriorFiles()