From 6bffd4d4bbaab5b0e75c86a5f9adee3b6c080712 Mon Sep 17 00:00:00 2001 From: Maarten ter Huurne Date: Tue, 23 Sep 2008 10:05:46 +0000 Subject: [PATCH] Use existing File::IsDirectory() function. Thanks to nakee for pointing this out. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@639 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/DiscIO/Src/VolumeDirectory.cpp | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/Source/Core/DiscIO/Src/VolumeDirectory.cpp b/Source/Core/DiscIO/Src/VolumeDirectory.cpp index ccd15bdcb3..33ae382d14 100644 --- a/Source/Core/DiscIO/Src/VolumeDirectory.cpp +++ b/Source/Core/DiscIO/Src/VolumeDirectory.cpp @@ -20,14 +20,12 @@ #include #include #else -#include -#include -#include #include #endif #include "VolumeDirectory.h" #include "FileBlob.h" +#include "FileUtil.h" namespace DiscIO { @@ -76,22 +74,7 @@ CVolumeDirectory::~CVolumeDirectory() bool CVolumeDirectory::IsValidDirectory(const std::string& _rDirectory) { std::string directoryName = ExtractDirectoryName(_rDirectory); - -#ifdef _WIN32 - WIN32_FIND_DATA ffd; - HANDLE hFind = FindFirstFile(directoryName.c_str(), &ffd); - - if (hFind == INVALID_HANDLE_VALUE) - return false; - - return true; -#else - struct stat info; - if (!stat(directoryName.c_str(), &info)) - return false; - - return S_ISDIR(info.st_mode); -#endif + return File::IsDirectory(directoryName.c_str()); } bool CVolumeDirectory::Read(u64 _Offset, u64 _Length, u8* _pBuffer) const