diff options
author | Alex Zolotarev <deathbaba@gmail.com> | 2011-10-31 01:45:39 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:27:12 +0300 |
commit | 64ebd99c4c1e008587c794b86f1e47f8983face3 (patch) | |
tree | 5b3dad4e45d292728be6c8d5c944b82b34c0a1da /platform | |
parent | d08095cac1fa2d5b042941e8ddd5604325f7e6fb (diff) |
[win] Fixed test aflet platform refactoring
Diffstat (limited to 'platform')
-rw-r--r-- | platform/platform_win.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/platform/platform_win.cpp b/platform/platform_win.cpp index b0013e7c95..4d454f22f2 100644 --- a/platform/platform_win.cpp +++ b/platform/platform_win.cpp @@ -1,11 +1,12 @@ #include "platform.hpp" +#include "../base/logging.hpp" + #include "../coding/file_writer.hpp" #include "../std/windows.hpp" #include <shlobj.h> -#include <sys/stat.h> static bool GetUserWritableDir(string & outDir) { @@ -64,13 +65,13 @@ Platform::Platform() { FileWriter tmpfile(m_resourcesDir + "mapswithmetmptestfile"); tmpfile.Write("Hi from Alex!", 13); - FileWriter::DeleteFileX(m_resourcesDir + "mapswithmetmptestfile"); m_writableDir = m_resourcesDir; } - catch (FileWriter::RootException const &) + catch (RootException const &) { CHECK(GetUserWritableDir(m_writableDir), ("Can't get writable directory")); } + FileWriter::DeleteFileX(m_resourcesDir + "mapswithmetmptestfile"); LOG(LDEBUG, ("Resources Directory:", m_resourcesDir)); LOG(LDEBUG, ("Writable Directory:", m_writableDir)); @@ -82,8 +83,7 @@ Platform::~Platform() bool Platform::IsFileExists(string const & file) const { - struct _stat s; - return _stat(file.c_str(), &s) == 0; + return ::GetFileAttributesA(file.c_str()) != INVALID_FILE_ATTRIBUTES; } int Platform::CpuCores() const |