mirror of
https://github.com/kiwix/libkiwix.git
synced 2025-06-28 05:49:35 +00:00
+ fix fileExists() for Windows
This commit is contained in:
@ -24,6 +24,7 @@
|
||||
#include <limits.h>
|
||||
#elif _WIN32
|
||||
#include <windows.h>
|
||||
#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) {
|
||||
|
Reference in New Issue
Block a user