diff options
-rw-r--r-- | Source/cmSystemTools.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 3ea396c..81c4fa3 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(); |