diff options
author | Bartosz Taudul <wolf.pld@gmail.com> | 2019-07-25 21:44:10 +0300 |
---|---|---|
committer | Bartosz Taudul <wolf.pld@gmail.com> | 2019-07-25 21:44:10 +0300 |
commit | 0f574b5547a9b8a18f760908e7fea456fa562d56 (patch) | |
tree | 9e039efafc7382806f8dc927263844dffd8d1274 /server/TracyFilesystem.hpp | |
parent | 16a40f2e1fbca8ebc42d29b825e8bde296c6b6b2 (diff) |
Verify source file modification time against capture time.
Diffstat (limited to 'server/TracyFilesystem.hpp')
-rw-r--r-- | server/TracyFilesystem.hpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/server/TracyFilesystem.hpp b/server/TracyFilesystem.hpp index 8e05a497..31d64e0e 100644 --- a/server/TracyFilesystem.hpp +++ b/server/TracyFilesystem.hpp @@ -12,6 +12,16 @@ static inline bool FileExists( const char* fn ) return stat( fn, &buf ) == 0 && ( buf.st_mode & S_IFREG ) != 0; } +static inline bool SourceFileValid( const char* fn, uint64_t olderThan ) +{ + struct stat buf; + if( stat( fn, &buf ) == 0 && ( buf.st_mode & S_IFREG ) != 0 ) + { + return buf.st_mtime < olderThan; + } + return false; +} + } #endif |