]> git.treefish.org Git - phys/latlib.git/blobdiff - configcache.cpp
added outfile-flush
[phys/latlib.git] / configcache.cpp
index 670f02a02b9d8619c46b389d3536a772d19fc8ff..7718163da73038107a32f95d1ab9f55a5cd54adb 100644 (file)
@@ -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){