| 21 | } |
| 22 | |
| 23 | bool file::is_dir(const path &path) |
| 24 | { |
| 25 | #if OS_WIN |
| 26 | DWORD attr = GetFileAttributesW(path.wstring().c_str()); |
| 27 | if (attr == INVALID_FILE_ATTRIBUTES) |
| 28 | return false; |
| 29 | return attr & FILE_ATTRIBUTE_DIRECTORY; |
| 30 | #elif OS_MAC |
| 31 | struct stat buffer; |
| 32 | if (stat(path.string().c_str(), &buffer) == 0) { |
| 33 | return S_ISDIR(buffer.st_mode); |
| 34 | } |
| 35 | return false; |
| 36 | #endif |
| 37 | } |
| 38 | |
| 39 | bool file::is_file(const path &path) |
| 40 | { |