diff options
author | Ken Martin <ken.martin@kitware.com> | 2001-05-01 15:16:20 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2001-05-01 15:16:20 (GMT) |
commit | a99dfa60aed8b4446949c3f55e7b3ea517042bb4 (patch) | |
tree | 851088c4562a35976a9b7138831a02703d458ef3 /Source/cmVTKWrapTclCommand.cxx | |
parent | 2fb2207c1025f86cc5b62faf8c3a1ca15ea18152 (diff) | |
download | CMake-a99dfa60aed8b4446949c3f55e7b3ea517042bb4.zip CMake-a99dfa60aed8b4446949c3f55e7b3ea517042bb4.tar.gz CMake-a99dfa60aed8b4446949c3f55e7b3ea517042bb4.tar.bz2 |
new set command and IF NOT
Diffstat (limited to 'Source/cmVTKWrapTclCommand.cxx')
-rw-r--r-- | Source/cmVTKWrapTclCommand.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/cmVTKWrapTclCommand.cxx b/Source/cmVTKWrapTclCommand.cxx index 995f863..44579d9 100644 --- a/Source/cmVTKWrapTclCommand.cxx +++ b/Source/cmVTKWrapTclCommand.cxx @@ -184,7 +184,8 @@ bool cmVTKWrapTclCommand::WriteInit(const char *kitName, std::vector<std::string>& classes) { 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; @@ -259,6 +260,11 @@ bool cmVTKWrapTclCommand::WriteInit(const char *kitName, fprintf(fout," return TCL_OK;\n}\n"); fclose(fout); + // copy the file if different + cmSystemTools::CopyFileIfDifferent(tempOutputFile.c_str(), + outFileName.c_str()); + cmSystemTools::RemoveFile(tempOutputFile.c_str()); + return true; } |