MCPcopy Create free account
hub / github.com/chipsalliance/Surelog / mkdirs

Method mkdirs

src/Common/PlatformFileSystem.cpp:809–829  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

807}
808
809bool PlatformFileSystem::mkdirs(PathId dirId) {
810 if (!dirId) return false;
811
812 const std::filesystem::path dir = toPath(dirId);
813 if (dir.empty()) return false;
814
815 std::error_code ec;
816 if ((std::filesystem::exists(dir, ec) && !ec) &&
817 (std::filesystem::is_directory(dir, ec) && !ec)) {
818 return true;
819 }
820
821 // CAUTION: There is a known bug in VC compiler where a trailing
822 // slash in the path will cause a false return from a call to
823 // fs::create_directories.
824 // if (!std::filesystem::create_directories(dir, ec) || ec) {
825 std::filesystem::create_directories(dir, ec);
826 if (ec) return false;
827
828 return std::filesystem::is_directory(dir, ec) && !ec;
829}
830
831bool PlatformFileSystem::rmtree(PathId dirId) {
832 if (!dirId) return false;

Callers 10

prepareCompilation_Method · 0.45
setupCache_Method · 0.45
saveMethod · 0.45
saveMethod · 0.45
saveMethod · 0.45
TESTFunction · 0.45
checkMethod · 0.45
postPreprocess_Method · 0.45

Calls

no outgoing calls

Tested by 1

TESTFunction · 0.36