summaryrefslogtreecommitdiffstats
path: root/Source/cmVTKWrapPythonCommand.cxx
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2001-05-01 15:16:20 (GMT)
committerKen Martin <ken.martin@kitware.com>2001-05-01 15:16:20 (GMT)
commita99dfa60aed8b4446949c3f55e7b3ea517042bb4 (patch)
tree851088c4562a35976a9b7138831a02703d458ef3 /Source/cmVTKWrapPythonCommand.cxx
parent2fb2207c1025f86cc5b62faf8c3a1ca15ea18152 (diff)
downloadCMake-a99dfa60aed8b4446949c3f55e7b3ea517042bb4.zip
CMake-a99dfa60aed8b4446949c3f55e7b3ea517042bb4.tar.gz
CMake-a99dfa60aed8b4446949c3f55e7b3ea517042bb4.tar.bz2
new set command and IF NOT
Diffstat (limited to 'Source/cmVTKWrapPythonCommand.cxx')
-rw-r--r--Source/cmVTKWrapPythonCommand.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/Source/cmVTKWrapPythonCommand.cxx b/Source/cmVTKWrapPythonCommand.cxx
index d1977cc..2c84b5f 100644
--- a/Source/cmVTKWrapPythonCommand.cxx
+++ b/Source/cmVTKWrapPythonCommand.cxx
@@ -185,7 +185,8 @@ bool cmVTKWrapPythonCommand::WriteInit(const char *kitName,
{
unsigned int i;
- FILE *fout = fopen(outFileName.c_str(),"w");
+ std::string tempOutputFile = outFileName + ".tmp";
+ FILE *fout = fopen(tempOutputFile.c_str(),"w");
if (!fout)
{
return false;
@@ -230,6 +231,10 @@ bool cmVTKWrapPythonCommand::WriteInit(const char *kitName,
fclose(fout);
+ // copy the file if different
+ cmSystemTools::CopyFileIfDifferent(tempOutputFile.c_str(),
+ outFileName.c_str());
+ cmSystemTools::RemoveFile(tempOutputFile.c_str());
return true;
}