MCPcopy Create free account
hub / github.com/alibaba/MNN / MNNDirExist

Function MNNDirExist

source/core/MNNFileUtils.cpp:20–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18}
19
20bool MNNDirExist(const char * path) {
21#if defined(WIN32) || defined(_WIN32) || defined(_WIN64) || defined(_MSC_VER)
22 DWORD file_attributes = GetFileAttributes(path);
23 return (file_attributes != INVALID_FILE_ATTRIBUTES) && (file_attributes & FILE_ATTRIBUTE_DIRECTORY);
24#else
25 struct stat info;
26 return (stat(path, &info) == 0) && (info.st_mode & S_IFDIR);
27#endif
28}
29
30bool MNNFileExist(const char * file_name)
31{

Callers 2

loadMethod · 0.85
MNNCreateDirFunction · 0.85

Calls 1

statClass · 0.70

Tested by

no test coverage detected