diff --git a/server/TracyFilesystem.cpp b/server/TracyFilesystem.cpp index e33de71c..6b4bdd8a 100644 --- a/server/TracyFilesystem.cpp +++ b/server/TracyFilesystem.cpp @@ -14,4 +14,14 @@ bool SourceFileValid( const char* fn, uint64_t olderThan, const View& view ) return false; } +bool SourceFileValid( const char* fn, uint64_t olderThan ) +{ + struct stat buf; + if( stat( fn, &buf ) == 0 && ( buf.st_mode & S_IFREG ) != 0 ) + { + return (uint64_t)buf.st_mtime < olderThan; + } + return false; +} + } diff --git a/server/TracyFilesystem.hpp b/server/TracyFilesystem.hpp index 40c9a62f..8b246dee 100644 --- a/server/TracyFilesystem.hpp +++ b/server/TracyFilesystem.hpp @@ -16,6 +16,7 @@ static inline bool FileExists( const char* fn ) } bool SourceFileValid( const char* fn, uint64_t olderThan, const View& view ); +bool SourceFileValid( const char* fn, uint64_t olderThan ); }