1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Add file existence check.

This commit is contained in:
Bartosz Taudul
2018-08-17 13:35:33 +02:00
parent 27b2851291
commit 6bf7b85260
3 changed files with 21 additions and 0 deletions
+17
View File
@@ -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