From 6b382d09f3825aca16f33e28e479b663d22e8a43 Mon Sep 17 00:00:00 2001 From: Alex Schmidt Date: Tue, 21 Aug 2012 17:18:57 +0200 Subject: [PATCH 1/1] ... --- writeout.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/writeout.cpp b/writeout.cpp index 73adfa6..0cb486c 100644 --- a/writeout.cpp +++ b/writeout.cpp @@ -26,7 +26,7 @@ writeout::writeout(const string& wdir, const string& signature, if(wdir != ""){ numprocs = procs; sprintf(cRank, "%d", rank); - fulldir = wdir + "/" + tstamp(timestamp) + "_" + signature; + fulldir = wdir + "/" + tstamp(timestamp) + "_" + signature + ".tmp"; mkdir( fulldir.c_str(), 0775); if(rank>0) of.open( (fulldir + "/rank" + cRank + ".tmp").c_str() ); @@ -69,6 +69,7 @@ writeout::~writeout() } of << "#end" << endl << flush; of.close(); + rename( fulldir.c_str(), fulldir.substr(0, fulldir.length()-4).c_str() ); } else { -- 2.39.5