Skip to content
Snippets Groups Projects
Commit ef746790 authored by Giovanni Bussi's avatar Giovanni Bussi
Browse files

Merge branch 'v2.0'

parents e49cba3a 2c272e4a
No related branches found
No related tags found
No related merge requests found
......@@ -69,7 +69,14 @@ Unreleased changes
-------------
See <a href="http://github.com/plumed/plumed2/tree/v2.0">branch v2.0 on git repository</a>.
There are currently no unreleased changes.
For users:
- Added full reference (page/number) to published paper in doc and log.
- Fixed a bug in file backups (only affecting Windows version - thanks to T. Giorgino).
- Several small fixes in documentation and log file.
For developers:
- Fixed makefile dependencies in some auxiliary files in src/lib (src/lib/*cmake and src/lib/*inc).
- Several small fixes in documentation.
*/
......@@ -32,6 +32,7 @@
#include <iostream>
#include <string>
#include <cstdlib>
#include <cerrno>
namespace PLMD{
......@@ -240,6 +241,7 @@ void OFile::backupFile( const std::string& bstring, const std::string& fname ){
FILE* ff=std::fopen(const_cast<char*>(fname.c_str()),"r");
FILE* fff=NULL;
if(ff){
std::fclose(ff);
std::string backup;
size_t found=fname.find_last_of("/\\");
std::string directory=fname.substr(0,found+1);
......@@ -251,12 +253,11 @@ void OFile::backupFile( const std::string& bstring, const std::string& fname ){
backup=directory+bstring +"."+num+"."+file;
fff=std::fopen(backup.c_str(),"r");
if(!fff) break;
else std::fclose(fff);
}
int check=rename(fname.c_str(),backup.c_str());
plumed_massert(check==0,"renaming "+fname+" into "+backup+" failed for some reason");
plumed_massert(check==0,"renaming "+fname+" into "+backup+" failed for reason: "+strerror(errno));
}
if(ff) std::fclose(ff);
if(fff) std::fclose(fff);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment