X-Git-Url: http://git.treefish.org/~alex/phys/latlib.git/blobdiff_plain/5b9a4591ebd7445b016e2d9e5d54bf4bac4ea6e9..61edeced8a739372ee93a0fe839adeb5ad5e77c3:/configcache.cpp?ds=sidebyside diff --git a/configcache.cpp b/configcache.cpp index 670f02a..7718163 100644 --- a/configcache.cpp +++ b/configcache.cpp @@ -80,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; } @@ -130,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; @@ -139,6 +139,8 @@ void configcache::writeConfig() } boost::iostreams::write(*outBuffer, configMem, configSize); + + outFile.flush(); } void configcache::addPara(const string& parid, const double& val){