Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Implemented FileExists.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 17 Jan 2016 09:52:02 +0000 (09:52 +0000)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 17 Jan 2016 09:52:02 +0000 (09:52 +0000)
source/common/file.cpp [new file with mode: 0644]
source/common/file.h [new file with mode: 0644]

diff --git a/source/common/file.cpp b/source/common/file.cpp
new file mode 100644 (file)
index 0000000..da236b3
--- /dev/null
@@ -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 (file)
index 0000000..84ca16f
--- /dev/null
@@ -0,0 +1,9 @@
+#include <string>
+#include <iostream>
+#if defined (__WIN32__)
+
+#else
+#include <sys/unistd.h>
+#endif
+
+bool FileExists(std::string Filename);
\ No newline at end of file
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy