| 18 | } |
| 19 | |
| 20 | bool 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 | |
| 30 | bool MNNFileExist(const char * file_name) |
| 31 | { |
no test coverage detected