Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/wolfpld/tracy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartosz Taudul <wolf.pld@gmail.com>2018-08-17 14:35:33 +0300
committerBartosz Taudul <wolf.pld@gmail.com>2018-08-17 14:35:33 +0300
commit6bf7b85260c23695d8aff1267bc76aa4fa93e80f (patch)
tree573bf0c3e3703f802911f5f980279577a0670e39 /server/TracyFilesystem.hpp
parent27b285129169b3e45c2e21ac6c2cfe44f1e54422 (diff)
Add file existence check.
Diffstat (limited to 'server/TracyFilesystem.hpp')
-rw-r--r--server/TracyFilesystem.hpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/server/TracyFilesystem.hpp b/server/TracyFilesystem.hpp
new file mode 100644
index 00000000..8e05a497
--- /dev/null
+++ b/server/TracyFilesystem.hpp
@@ -0,0 +1,17 @@
+#ifndef __TRACYFILESYSTEM_HPP__
+#define __TRACYFILESYSTEM_HPP__
+
+#include <sys/stat.h>
+
+namespace tracy
+{
+
+static inline bool FileExists( const char* fn )
+{
+ struct stat buf;
+ return stat( fn, &buf ) == 0 && ( buf.st_mode & S_IFREG ) != 0;
+}
+
+}
+
+#endif