diff options
| author | Pierre Bourdon <delroth@gmail.com> | 2018-05-05 02:35:21 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-05-05 02:35:21 +0200 |
| commit | 5106724c85a9b685d040abdc85e9449d87611349 (patch) | |
| tree | 00e5258b77961723b57824d8470e83273726434f /Source/Core/Common/FileUtil.cpp | |
| parent | 91a447394bf07d8e4f6453dee8cb425190a98c78 (diff) | |
| parent | db0e5108dc2e79732a0ba700a48d544fbeaba99e (diff) | |
Merge pull request #6753 from spycrab/fileutil_win32
Win32/FileUtil: Fix IsDirectory() not working for certain directories
Diffstat (limited to 'Source/Core/Common/FileUtil.cpp')
| -rw-r--r-- | Source/Core/Common/FileUtil.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Source/Core/Common/FileUtil.cpp b/Source/Core/Common/FileUtil.cpp index 85f252f143..88b17c99c6 100644 --- a/Source/Core/Common/FileUtil.cpp +++ b/Source/Core/Common/FileUtil.cpp @@ -24,6 +24,7 @@ #ifdef _WIN32 #include <windows.h> +#include <Shlwapi.h> #include <commdlg.h> // for GetSaveFileName #include <direct.h> // getcwd #include <io.h> @@ -111,7 +112,11 @@ bool Exists(const std::string& path) // Returns true if the path exists and is a directory bool IsDirectory(const std::string& path) { +#ifdef _WIN32 + return PathIsDirectory(UTF8ToUTF16(path).c_str()); +#else return FileInfo(path).IsDirectory(); +#endif } // Returns true if the path exists and is a file |
