From c96c3c382fce965f70d4ad8fc4881aa922c5a13f Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 20 Nov 2002 12:58:29 -0500 Subject: [PATCH] BUG: Attempt to fix CopyFile problem using flush before check for success. --- Source/cmSystemTools.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 3ea396c35..81c4fa3ae 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1246,7 +1246,12 @@ void cmSystemTools::cmCopyFile(const char* source, fout.write(buffer, fin.gcount()); } } - + + // Make sure the operating system has finished writing the file + // before closing it. This will ensure the file is finished before + // the check below. + fout.flush(); + fin.close(); fout.close();