diff options
author | Brad King <brad.king@kitware.com> | 2004-11-03 12:23:18 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2004-11-03 12:23:18 (GMT) |
commit | d46d8df0edfcfac46390319db8213601a5cd4260 (patch) | |
tree | 86f2c559e3983463981ea30e59fa25193207dfb2 /Source/cmVTKMakeInstantiatorCommand.cxx | |
parent | 3050e231b35c7b8b3e1dfcc37275dddb3b5d7445 (diff) | |
download | CMake-d46d8df0edfcfac46390319db8213601a5cd4260.zip CMake-d46d8df0edfcfac46390319db8213601a5cd4260.tar.gz CMake-d46d8df0edfcfac46390319db8213601a5cd4260.tar.bz2 |
ENH: Re-implemented cmGeneratedFileStream to look like a real stream and replace the destination file atomically. This will avoid problems with the process being terminated while generating a file.
Diffstat (limited to 'Source/cmVTKMakeInstantiatorCommand.cxx')
-rw-r--r-- | Source/cmVTKMakeInstantiatorCommand.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Source/cmVTKMakeInstantiatorCommand.cxx b/Source/cmVTKMakeInstantiatorCommand.cxx index 6626924..6f2239b 100644 --- a/Source/cmVTKMakeInstantiatorCommand.cxx +++ b/Source/cmVTKMakeInstantiatorCommand.cxx @@ -127,16 +127,16 @@ cmVTKMakeInstantiatorCommand std::string fullName = headerPath+"/"+fileName; // Generate the output file with copy-if-different. - cmGeneratedFileStream fout(fullName.c_str()); + cmGeneratedFileStream fout(fullName.c_str(), true); // Actually generate the code in the file. if(!oldVersion) { - this->GenerateHeaderFile(fout.GetStream()); + this->GenerateHeaderFile(fout); } else { - this->OldGenerateHeaderFile(fout.GetStream()); + this->OldGenerateHeaderFile(fout); } } @@ -147,16 +147,16 @@ cmVTKMakeInstantiatorCommand // Generate the output file with copy-if-different. { - cmGeneratedFileStream fout(fullName.c_str()); + cmGeneratedFileStream fout(fullName.c_str(), true); // Actually generate the code in the file. if(!oldVersion) { - this->GenerateImplementationFile(fout.GetStream()); + this->GenerateImplementationFile(fout); } else { - this->OldGenerateImplementationFile(fout.GetStream()); + this->OldGenerateImplementationFile(fout); } } @@ -188,13 +188,13 @@ cmVTKMakeInstantiatorCommand // Generate the output file with copy-if-different. { - cmGeneratedFileStream fout(fullName.c_str()); + cmGeneratedFileStream fout(fullName.c_str(), true); size_t thisBlockSize = (block < numFullBlocks)? groupSize:lastBlockSize; // Actually generate the code in the file. - this->OldGenerateCreationFile(fout.GetStream(), + this->OldGenerateCreationFile(fout, block*groupSize, static_cast<int>(thisBlockSize)); } |