X-Git-Url: http://git.treefish.org/~alex/phys/latlib.git/blobdiff_plain/5adde094541b74abf79a902dc4b63141d281b818..61edeced8a739372ee93a0fe839adeb5ad5e77c3:/configcache.cpp diff --git a/configcache.cpp b/configcache.cpp index 1c4aa05..7718163 100644 --- a/configcache.cpp +++ b/configcache.cpp @@ -4,7 +4,6 @@ #include #include #include -#include configcache::configcache(const string& cacheid, const int& nequi, const int& nskip, const string& datadir, char **configmem, const int& configMemSize){ NEQUI = nequi; @@ -81,7 +80,7 @@ bool configcache::isValidInFile(const string& infile) delete[] inchar; - if( truncIn.find( getFileId(true) ) == string::npos ) return false; + if( truncIn.find( getFileId(true) + "_" ) == string::npos ) return false; return true; } @@ -131,7 +130,7 @@ void configcache::writeConfig() time_t secstamp = time(NULL); outFileName.str(""); - outFileName << DATADIR << "/" << secstamp << "_" << getFileId() << ".dat.tmp"; + outFileName << DATADIR << "/" << secstamp << "_" << getFileId() << "_.dat.tmp"; outFile.open( outFileName.str().c_str(), std::ios::binary ); outBuffer = new boost::iostreams::filtering_ostreambuf; @@ -140,6 +139,8 @@ void configcache::writeConfig() } boost::iostreams::write(*outBuffer, configMem, configSize); + + outFile.flush(); } void configcache::addPara(const string& parid, const double& val){