2018-08-17 11:35:33 +00:00
|
|
|
#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;
|
|
|
|
}
|
|
|
|
|
2019-07-25 18:44:10 +00:00
|
|
|
static inline bool SourceFileValid( const char* fn, uint64_t olderThan )
|
|
|
|
{
|
|
|
|
struct stat buf;
|
|
|
|
if( stat( fn, &buf ) == 0 && ( buf.st_mode & S_IFREG ) != 0 )
|
|
|
|
{
|
2020-03-01 00:48:20 +00:00
|
|
|
return (uint64_t)buf.st_mtime < olderThan;
|
2019-07-25 18:44:10 +00:00
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2018-08-17 11:35:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|