From 6470ee1a051a4e4fac014162c0d9632487093d08 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 5 Jan 2010 00:17:29 +0000 Subject: Removed some silly debugging output and added the StatCache, it turns out this doesn't matter, at least on linux...but...it's a nice idea? I dunno. --- src/statcache.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/statcache.cpp (limited to 'src/statcache.cpp') diff --git a/src/statcache.cpp b/src/statcache.cpp new file mode 100644 index 0000000..3f5c21f --- /dev/null +++ b/src/statcache.cpp @@ -0,0 +1,28 @@ +#include "statcache.h" + +#include + +#include + +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; + } +} + -- cgit v1.2.3