From f69edcf9c05589e424156a698ac886be1adbc193 Mon Sep 17 00:00:00 2001 From: Kelson42 Date: Mon, 19 May 2014 23:55:56 +0200 Subject: [PATCH] + fix fileExists() for Windows --- src/common/pathTools.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/common/pathTools.cpp b/src/common/pathTools.cpp index ee636e994..ffd52b8b5 100644 --- a/src/common/pathTools.cpp +++ b/src/common/pathTools.cpp @@ -24,6 +24,7 @@ #include #elif _WIN32 #include +#include "Shlwapi.h" #endif #ifdef _WIN32 @@ -167,6 +168,9 @@ string getFileSizeAsString(const string &path) { } bool fileExists(const string &path) { +#ifdef _WIN32 + return PathFileExists(path.c_str()); +#else bool flag = false; fstream fin; fin.open(path.c_str(), ios::in); @@ -175,6 +179,7 @@ bool fileExists(const string &path) { } fin.close(); return flag; +#endif } bool makeDirectory(const string &path) {