diff options
author | Bartosz Taudul <wolf.pld@gmail.com> | 2018-08-17 14:35:33 +0300 |
---|---|---|
committer | Bartosz Taudul <wolf.pld@gmail.com> | 2018-08-17 14:35:33 +0300 |
commit | 6bf7b85260c23695d8aff1267bc76aa4fa93e80f (patch) | |
tree | 573bf0c3e3703f802911f5f980279577a0670e39 /server/TracyFilesystem.hpp | |
parent | 27b285129169b3e45c2e21ac6c2cfe44f1e54422 (diff) |
Add file existence check.
Diffstat (limited to 'server/TracyFilesystem.hpp')
-rw-r--r-- | server/TracyFilesystem.hpp | 17 |
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 |