Substitution-less source file validator.

This commit is contained in:
Bartosz Taudul 2020-05-23 13:56:09 +02:00
parent fa2559b3f0
commit d052e4c79d
2 changed files with 11 additions and 0 deletions

View File

@ -14,4 +14,14 @@ bool SourceFileValid( const char* fn, uint64_t olderThan, const View& view )
return false; 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;
}
} }

View File

@ -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, const View& view );
bool SourceFileValid( const char* fn, uint64_t olderThan );
} }