1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
#include "statcache.h" #include <sys/stat.h> #include <bu/sio.h> StatCache::StatCache() { } StatCache::~StatCache() { } time_t StatCache::mtime( const Bu::FString &sFileName ) { try { return hMTime.get( sFileName ); } catch( ... ) { struct stat s; stat( sFileName.getStr(), &s ); hMTime.insert( sFileName, s.st_mtime ); return s.st_mtime; } }