diff --git a/src/file.cpp b/src/file.cpp index 82158c1..2273446 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -851,6 +851,23 @@ namespace bx return false; } + if (0 != (st.st_mode & _S_IFREG) ) + { + _outFileInfo.type = FileType::File; + } + else if (0 != (st.st_mode & _S_IFDIR) ) + { + _outFileInfo.type = FileType::Dir; + } +# elif BX_CRT_MSVC + struct ::_stat64 st; + int32_t result = ::_stat64(_filePath.getCPtr(), &st); + + if (0 != result) + { + return false; + } + if (0 != (st.st_mode & _S_IFREG) ) { _outFileInfo.type = FileType::File; @@ -898,6 +915,8 @@ namespace bx ? ::_wmkdir(filePath) : -1 ; +#elif BX_CRT_MSVC + int32_t result = ::_mkdir(_filePath.getCPtr() ); #elif BX_CRT_NONE BX_UNUSED(_filePath); int32_t result = -1; @@ -974,6 +993,17 @@ namespace bx : ::_wremove(filePath) ; } +#elif BX_CRT_MSVC + int32_t result = -1; + FileInfo fi; + + if (stat(fi, _filePath) ) + { + result = FileType::Dir == fi.type + ? ::_rmdir(_filePath.getCPtr() ) + : ::remove(_filePath.getCPtr() ) + ; + } #elif BX_CRT_NONE BX_UNUSED(_filePath); int32_t result = -1; diff --git a/src/filepath.cpp b/src/filepath.cpp index ec1fce6..e2339cb 100644 --- a/src/filepath.cpp +++ b/src/filepath.cpp @@ -10,7 +10,7 @@ #if BX_PLATFORM_WINDOWS # include // _wgetcwd -#else +#elif !BX_CRT_MSVC # include // getcwd #endif // BX_PLATFORM_WINDOWS