tracy/server/TracyFilesystem.cpp

19 lines
452 B
C++
Raw Permalink Normal View History

2020-04-17 17:09:13 +00:00
#include "TracyFilesystem.hpp"
#include "TracyView.hpp"
namespace tracy
{
2020-05-23 13:14:57 +00:00
bool SourceFileValid( const char* fn, uint64_t olderThan, const View& view, const Worker& worker )
2020-04-17 17:09:13 +00:00
{
2020-05-23 13:14:57 +00:00
if( worker.GetSourceFileFromCache( fn ).data != nullptr ) return true;
2020-04-17 17:09:13 +00:00
struct stat buf;
if( stat( view.SourceSubstitution( fn ), &buf ) == 0 && ( buf.st_mode & S_IFREG ) != 0 )
{
return (uint64_t)buf.st_mtime < olderThan;
}
return false;
}
}