summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalKdevelopGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2004-11-03 12:23:18 (GMT)
committerBrad King <brad.king@kitware.com>2004-11-03 12:23:18 (GMT)
commitd46d8df0edfcfac46390319db8213601a5cd4260 (patch)
tree86f2c559e3983463981ea30e59fa25193207dfb2 /Source/cmLocalKdevelopGenerator.cxx
parent3050e231b35c7b8b3e1dfcc37275dddb3b5d7445 (diff)
downloadCMake-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/cmLocalKdevelopGenerator.cxx')
-rw-r--r--Source/cmLocalKdevelopGenerator.cxx16
1 files changed, 3 insertions, 13 deletions
diff --git a/Source/cmLocalKdevelopGenerator.cxx b/Source/cmLocalKdevelopGenerator.cxx
index 5328fff..03c77b1 100644
--- a/Source/cmLocalKdevelopGenerator.cxx
+++ b/Source/cmLocalKdevelopGenerator.cxx
@@ -120,12 +120,9 @@ void cmLocalKdevelopGenerator::MergeProjectFiles(const std::string& outputDir,
}
oldProjectFile.close();
- cmGeneratedFileStream tempFile(filename.c_str());
- tempFile.SetAlwaysCopy(true);
- std::ostream& fout = tempFile.GetStream();
+ cmGeneratedFileStream fout(filename.c_str(), false);
if(!fout)
{
- cmSystemTools::Error("Error can not open for write: ", filename.c_str());
return;
}
@@ -174,13 +171,9 @@ void cmLocalKdevelopGenerator::CreateNewProjectFile(const std::string& outputDir
const std::string& cmakeFilePattern)
{
- cmGeneratedFileStream tempFile(filename.c_str());
- tempFile.SetAlwaysCopy(true);
-
- std::ostream& fout = tempFile.GetStream();
+ cmGeneratedFileStream fout(filename.c_str(), false);
if(!fout)
{
- cmSystemTools::Error("Error can not open for write: ", filename.c_str());
return;
}
@@ -371,12 +364,9 @@ bool cmLocalKdevelopGenerator::CreateFilelistFile(const std::string& outputDir,
}
//now write the new filename
- cmGeneratedFileStream tempFile(filename.c_str());
- tempFile.SetAlwaysCopy(true);
- std::ostream& fout = tempFile.GetStream();
+ cmGeneratedFileStream fout(filename.c_str(), false);
if(!fout)
{
- cmSystemTools::Error("Error can not open for write: ", filename.c_str());
return false;
}