From: Steve Brokenshire Date: Sun, 17 Jan 2016 09:52:02 +0000 (+0000) Subject: Implemented FileExists. X-Git-Tag: release-0.02~776 X-Git-Url: http://Server1/repobrowser/?p=xestiacalendar%2F.git;a=commitdiff_plain;h=9f8384349b3a6fee3160ad6f835d7ec7b1b2d93f Implemented FileExists. --- diff --git a/source/common/file.cpp b/source/common/file.cpp new file mode 100644 index 0000000..da236b3 --- /dev/null +++ b/source/common/file.cpp @@ -0,0 +1,23 @@ +#include "file.h" + +using namespace std; + +bool FileExists(std::string Filename){ + +#if defined (__WIN32__) + +#else + + const char *FilenameChar = Filename.c_str(); + + int rescode = access(FilenameChar, R_OK); + + if (errno == ENOENT){ + return false; + } + +#endif + + return true; + +} \ No newline at end of file diff --git a/source/common/file.h b/source/common/file.h new file mode 100644 index 0000000..84ca16f --- /dev/null +++ b/source/common/file.h @@ -0,0 +1,9 @@ +#include +#include +#if defined (__WIN32__) + +#else +#include +#endif + +bool FileExists(std::string Filename); \ No newline at end of file