MCPcopy Create free account
hub / github.com/Xtra-Computing/thundersvm / pathExists

Method pathExists

src/thundersvm/util/log.cpp:685–700  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

683 }
684
685 bool File::pathExists(const char* path, bool considerFile) {
686 if (path == nullptr) {
687 return false;
688 }
689#if ELPP_OS_UNIX
690 ELPP_UNUSED(considerFile);
691 struct stat st;
692 return (stat(path, &st) == 0);
693#elif ELPP_OS_WINDOWS
694 DWORD fileType = GetFileAttributesA(path);
695 if (fileType == INVALID_FILE_ATTRIBUTES) {
696 return false;
697 }
698 return considerFile ? true : ((fileType & FILE_ATTRIBUTE_DIRECTORY) == 0 ? false : true);
699#endif // ELPP_OS_UNIX
700 }
701
702 bool File::createPath(const std::string& path) {
703 if (path.empty()) {

Callers

nothing calls this directly

Calls 1

statClass · 0.85

Tested by

no test coverage detected