Retursn true if a directory exists
| 29 | |
| 30 | // Retursn true if a directory exists |
| 31 | bool DirectoryExists(const wchar* dirPath) |
| 32 | { |
| 33 | if(dirPath == NULL) |
| 34 | return false; |
| 35 | |
| 36 | DWORD fileAttr = GetFileAttributes(dirPath); |
| 37 | return (fileAttr != INVALID_FILE_ATTRIBUTES && (fileAttr & FILE_ATTRIBUTE_DIRECTORY)); |
| 38 | } |
| 39 | |
| 40 | |
| 41 | // Returns the directory containing a file |