From ff15fb07fcb6760beb8c5ee4bad634e99e6bdab2 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Fri, 2 Jun 2017 22:18:00 +0200 Subject: [PATCH] [IO] More efficient file check --- src/Utils/IO.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Utils/IO.cpp b/src/Utils/IO.cpp index fa9eba97..b7ca7ff7 100644 --- a/src/Utils/IO.cpp +++ b/src/Utils/IO.cpp @@ -6,7 +6,8 @@ namespace Utils { bool FileExists(std::string file) { - return std::ifstream(file).good(); + //return std::ifstream(file).good(); + return GetFileAttributesA(file.data()) != INVALID_FILE_ATTRIBUTES; } bool WriteFile(std::string file, std::string data, bool append)