This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  68b0ed4e365c77d1eb2109b17fa11d358f1a575b (commit)
       via  853f85da0ad03271cd0a3a1bdbfc0aa7d2910b3f (commit)
      from  41ecb26fc477d763a455738f0ab0485770149d7c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=68b0ed4e365c77d1eb2109b17fa11d358f1a575b
commit 68b0ed4e365c77d1eb2109b17fa11d358f1a575b
Merge: 41ecb26 853f85d
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Tue Jun 14 09:13:59 2016 -0400
Commit:     CMake Topic Stage <kwro...@kitware.com>
CommitDate: Tue Jun 14 09:13:59 2016 -0400

    Merge topic 'std-fstream' into next
    
    853f85da Revert topic 'std-fstream'


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=853f85da0ad03271cd0a3a1bdbfc0aa7d2910b3f
commit 853f85da0ad03271cd0a3a1bdbfc0aa7d2910b3f
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Tue Jun 14 09:13:15 2016 -0400
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Tue Jun 14 09:13:40 2016 -0400

    Revert topic 'std-fstream'

diff --git a/Source/CPack/OSXScriptLauncher.cxx 
b/Source/CPack/OSXScriptLauncher.cxx
index 1b1457c..a233e76 100644
--- a/Source/CPack/OSXScriptLauncher.cxx
+++ b/Source/CPack/OSXScriptLauncher.cxx
@@ -28,7 +28,7 @@ int main(int argc, char* argv[])
 {
   // if ( cmsys::SystemTools::FileExists(
   std::string cwd = cmsys::SystemTools::GetCurrentWorkingDirectory();
-  std::ofstream ofs("/tmp/output.txt");
+  cmsys::ofstream ofs("/tmp/output.txt");
 
   CFStringRef fileName;
   CFBundleRef appBundle;
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx 
b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
index 9b240d8..8777296 100644
--- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx
+++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
@@ -66,7 +66,7 @@ bool cmCPackWIXGenerator::RunWiXCommand(std::string const& 
command)
                                                 &output, &returnValue, 0,
                                                 cmSystemTools::OUTPUT_NONE);
 
-  std::ofstream logFile(logFileName.c_str(), std::ios::app);
+  cmsys::ofstream logFile(logFileName.c_str(), std::ios::app);
   logFile << command << std::endl;
   logFile << output;
   logFile.close();
@@ -796,7 +796,7 @@ bool cmCPackWIXGenerator::CreateLicenseFile()
   } else if (extension == ".txt") {
     cmWIXRichTextFormatWriter rtfWriter(licenseDestinationFilename);
 
-    std::ifstream licenseSource(licenseSourceFilename.c_str());
+    cmsys::ifstream licenseSource(licenseSourceFilename.c_str());
 
     std::string line;
     while (std::getline(licenseSource, line)) {
diff --git a/Source/CPack/WiX/cmWIXRichTextFormatWriter.h 
b/Source/CPack/WiX/cmWIXRichTextFormatWriter.h
index 096f6ce..acf1fa6 100644
--- a/Source/CPack/WiX/cmWIXRichTextFormatWriter.h
+++ b/Source/CPack/WiX/cmWIXRichTextFormatWriter.h
@@ -48,7 +48,7 @@ private:
 
   void EmitInvalidCodepoint(int c);
 
-  std::ofstream File;
+  cmsys::ofstream File;
 };
 
 #endif
diff --git a/Source/CPack/WiX/cmWIXSourceWriter.h 
b/Source/CPack/WiX/cmWIXSourceWriter.h
index 781d813..4efc026 100644
--- a/Source/CPack/WiX/cmWIXSourceWriter.h
+++ b/Source/CPack/WiX/cmWIXSourceWriter.h
@@ -63,7 +63,7 @@ private:
 
   static std::string EscapeAttributeValue(std::string const& value);
 
-  std::ofstream File;
+  cmsys::ofstream File;
 
   State State;
 
diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx 
b/Source/CPack/cmCPackDragNDropGenerator.cxx
index b358778..f4379c1 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.cxx
+++ b/Source/CPack/cmCPackDragNDropGenerator.cxx
@@ -230,12 +230,12 @@ bool 
cmCPackDragNDropGenerator::CopyFile(std::ostringstream& source,
 bool cmCPackDragNDropGenerator::CreateEmptyFile(std::ostringstream& target,
                                                 size_t size)
 {
-  std::ofstream fout(target.str().c_str(), std::ios::out | std::ios::binary);
+  cmsys::ofstream fout(target.str().c_str(), std::ios::out | std::ios::binary);
   if (!fout) {
     return false;
   } else {
     // Seek to desired size - 1 byte
-    fout.seekp(size - 1, std::ios::beg);
+    fout.seekp(size - 1, std::ios_base::beg);
     char byte = 0;
     // Write one byte to ensure file grows
     fout.write(&byte, 1);
@@ -784,7 +784,7 @@ bool cmCPackDragNDropGenerator::WriteLicense(
   std::string actual_license = !licenseFile.empty()
     ? licenseFile
     : (slaDirectory + "/" + licenseLanguage + ".license.txt");
-  std::ifstream license_ifs;
+  cmsys::ifstream license_ifs;
   license_ifs.open(actual_license.c_str());
   if (license_ifs.is_open()) {
     while (license_ifs.good()) {
@@ -816,7 +816,7 @@ bool cmCPackDragNDropGenerator::WriteLicense(
     outputStream << "    {\n";
 
     // Menu body
-    std::ifstream menu_ifs;
+    cmsys::ifstream menu_ifs;
     menu_ifs.open(
       (slaDirectory + "/" + licenseLanguage + ".menu.txt").c_str());
     if (menu_ifs.is_open()) {
diff --git a/Source/CPack/cmCPackGenerator.cxx 
b/Source/CPack/cmCPackGenerator.cxx
index a147d3d..c8b075d 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -134,7 +134,7 @@ int cmCPackGenerator::PrepareNames()
                       << descFileName << "]" << std::endl);
       return 0;
     }
-    std::ifstream ifs(descFileName);
+    cmsys::ifstream ifs(descFileName);
     if (!ifs) {
       cmCPackLogger(cmCPackLog::LOG_ERROR,
                     "Cannot open description file name: " << descFileName
diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx 
b/Source/CPack/cmCPackPackageMakerGenerator.cxx
index 1230c71..ce329ca 100644
--- a/Source/CPack/cmCPackPackageMakerGenerator.cxx
+++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx
@@ -387,7 +387,7 @@ int cmCPackPackageMakerGenerator::InitializeInternal()
     return 0;
   }
 
-  std::ifstream ifs(versionFile.c_str());
+  cmsys::ifstream ifs(versionFile.c_str());
   if (!ifs) {
     cmCPackLogger(cmCPackLog::LOG_ERROR,
                   "Cannot open PackageMaker compiler version file"
@@ -523,7 +523,7 @@ bool cmCPackPackageMakerGenerator::GenerateComponentPackage(
     // X packages, which work on Mac OS X 10.3 and newer.
     std::string descriptionFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
     descriptionFile += '/' + component.Name + "-Description.plist";
-    std::ofstream out(descriptionFile.c_str());
+    cmsys::ofstream out(descriptionFile.c_str());
     cmXMLWriter xout(out);
     xout.StartDocument();
     xout.Doctype("plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\""
diff --git a/Source/CPack/cmCPackSTGZGenerator.cxx 
b/Source/CPack/cmCPackSTGZGenerator.cxx
index 9478146..4d07a7e 100644
--- a/Source/CPack/cmCPackSTGZGenerator.cxx
+++ b/Source/CPack/cmCPackSTGZGenerator.cxx
@@ -82,7 +82,7 @@ int cmCPackSTGZGenerator::GenerateHeader(std::ostream* os)
 
   std::string inLicFile = this->GetOption("CPACK_RESOURCE_FILE_LICENSE");
   std::string line;
-  std::ifstream ilfs(inLicFile.c_str());
+  cmsys::ifstream ilfs(inLicFile.c_str());
   std::string licenseText;
   while (cmSystemTools::GetLineFromStream(ilfs, line)) {
     licenseText += line + "\n";
@@ -94,7 +94,7 @@ int cmCPackSTGZGenerator::GenerateHeader(std::ostream* os)
 
   // Create the header
   std::string inFile = this->GetOption("CPACK_STGZ_HEADER_FILE");
-  std::ifstream ifs(inFile.c_str());
+  cmsys::ifstream ifs(inFile.c_str());
   std::string packageHeaderText;
   while (cmSystemTools::GetLineFromStream(ifs, line)) {
     packageHeaderText += line + "\n";
diff --git a/Source/CTest/cmCTestBatchTestHandler.cxx 
b/Source/CTest/cmCTestBatchTestHandler.cxx
index b3b3b17..70f84cb 100644
--- a/Source/CTest/cmCTestBatchTestHandler.cxx
+++ b/Source/CTest/cmCTestBatchTestHandler.cxx
@@ -31,7 +31,7 @@ void cmCTestBatchTestHandler::RunTests()
 void cmCTestBatchTestHandler::WriteBatchScript()
 {
   this->Script = this->CTest->GetBinaryDir() + "/Testing/CTestBatch.txt";
-  std::ofstream fout;
+  cmsys::ofstream fout;
   fout.open(this->Script.c_str());
   fout << "#!/bin/sh\n";
 
diff --git a/Source/CTest/cmCTestCVS.cxx b/Source/CTest/cmCTestCVS.cxx
index d93d113..5ddafbb 100644
--- a/Source/CTest/cmCTestCVS.cxx
+++ b/Source/CTest/cmCTestCVS.cxx
@@ -209,7 +209,7 @@ std::string cmCTestCVS::ComputeBranchFlag(std::string 
const& dir)
 
   // Lookup the branch in the tag file, if any.
   std::string tagLine;
-  std::ifstream tagStream(tagFile.c_str());
+  cmsys::ifstream tagStream(tagFile.c_str());
   if (tagStream && cmSystemTools::GetLineFromStream(tagStream, tagLine) &&
       tagLine.size() > 1 && tagLine[0] == 'T') {
     // Use the branch specified in the tag file.
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx 
b/Source/CTest/cmCTestCoverageHandler.cxx
index 8fa3fac..a631db9 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -487,7 +487,7 @@ int cmCTestCoverageHandler::ProcessHandler()
     covLogXML.Attribute("FullPath", shortFileName);
     covLogXML.StartElement("Report");
 
-    std::ifstream ifs(fullFileName.c_str());
+    cmsys::ifstream ifs(fullFileName.c_str());
     if (!ifs) {
       std::ostringstream ostr;
       ostr << "Cannot open source file: " << fullFileName;
@@ -567,7 +567,7 @@ int cmCTestCoverageHandler::ProcessHandler()
     covLogXML.Attribute("FullPath", *i);
     covLogXML.StartElement("Report");
 
-    std::ifstream ifs(fullPath.c_str());
+    cmsys::ifstream ifs(fullPath.c_str());
     if (!ifs) {
       std::ostringstream ostr;
       ostr << "Cannot open source file: " << fullPath;
@@ -899,7 +899,7 @@ int cmCTestCoverageHandler::HandleBlanketJSCoverage(
   // string on the second line
   std::string line;
   for (unsigned int fileEntry = 0; fileEntry < files.size(); fileEntry++) {
-    std::ifstream in(files[fileEntry].c_str());
+    cmsys::ifstream in(files[fileEntry].c_str());
     cmSystemTools::GetLineFromStream(in, line);
     cmSystemTools::GetLineFromStream(in, line);
     if (line.find("node-jscoverage") != line.npos) {
@@ -1190,7 +1190,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
                            "   in gcovFile: " << gcovFile << std::endl,
                            this->Quiet);
 
-        std::ifstream ifile(gcovFile.c_str());
+        cmsys::ifstream ifile(gcovFile.c_str());
         if (!ifile) {
           cmCTestLog(this->CTest, ERROR_MESSAGE,
                      "Cannot open file: " << gcovFile << std::endl);
@@ -1448,7 +1448,7 @@ int cmCTestCoverageHandler::HandleLCovCoverage(
       for (std::vector<std::string>::iterator a = lcovFiles.begin();
            a != lcovFiles.end(); ++a) {
         lcovFile = *a;
-        std::ifstream srcead(lcovFile.c_str());
+        cmsys::ifstream srcead(lcovFile.c_str());
         if (!srcead) {
           cmCTestLog(this->CTest, ERROR_MESSAGE,
                      "Cannot open file: " << lcovFile << std::endl);
@@ -1490,7 +1490,7 @@ int cmCTestCoverageHandler::HandleLCovCoverage(
                              "   in lcovFile: " << lcovFile << std::endl,
                              this->Quiet);
 
-          std::ifstream ifile(lcovFile.c_str());
+          cmsys::ifstream ifile(lcovFile.c_str());
           if (!ifile) {
             cmCTestLog(this->CTest, ERROR_MESSAGE,
                        "Cannot open file: " << lcovFile << std::endl);
@@ -1680,7 +1680,7 @@ int cmCTestCoverageHandler::HandleTracePyCoverage(
       &cont->TotalCoverage[actualSourceFile];
     cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
                        "   in file: " << *fileIt << std::endl, this->Quiet);
-    std::ifstream ifile(fileIt->c_str());
+    cmsys::ifstream ifile(fileIt->c_str());
     if (!ifile) {
       cmCTestLog(this->CTest, ERROR_MESSAGE,
                  "Cannot open file: " << *fileIt << std::endl);
@@ -1818,7 +1818,7 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch(
                      "covbr output in  " << outputFile << std::endl,
                      this->Quiet);
   // open the output file
-  std::ifstream fin(outputFile.c_str());
+  cmsys::ifstream fin(outputFile.c_str());
   if (!fin) {
     cmCTestLog(this->CTest, ERROR_MESSAGE,
                "Cannot open coverage file: " << outputFile << std::endl);
@@ -2006,7 +2006,7 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary(
   std::vector<std::string> coveredFiles;
   std::vector<std::string> coveredFilesFullPath;
   // Read and parse the summary output file
-  std::ifstream fin(outputFile.c_str());
+  cmsys::ifstream fin(outputFile.c_str());
   if (!fin) {
     cmCTestLog(this->CTest, ERROR_MESSAGE,
                "Cannot open coverage summary file: " << outputFile
@@ -2218,7 +2218,7 @@ void cmCTestCoverageHandler::LoadLabels()
   cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
                      " target directory list [" << fileList << "]\n",
                      this->Quiet);
-  std::ifstream finList(fileList.c_str());
+  cmsys::ifstream finList(fileList.c_str());
   std::string line;
   while (cmSystemTools::GetLineFromStream(finList, line)) {
     this->LoadLabels(line.c_str());
@@ -2230,7 +2230,7 @@ void cmCTestCoverageHandler::LoadLabels(const char* dir)
   LabelSet& dirLabels = this->TargetDirs[dir];
   std::string fname = dir;
   fname += "/Labels.txt";
-  std::ifstream fin(fname.c_str());
+  cmsys::ifstream fin(fname.c_str());
   if (!fin) {
     return;
   }
diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx
index fd51b3c..8b392f2 100644
--- a/Source/CTest/cmCTestGIT.cxx
+++ b/Source/CTest/cmCTestGIT.cxx
@@ -182,7 +182,7 @@ bool cmCTestGIT::UpdateByFetchAndReset()
   std::string sha1;
   {
     std::string fetch_head = this->FindGitDir() + "/FETCH_HEAD";
-    std::ifstream fin(fetch_head.c_str(), std::ios::in | std::ios::binary);
+    cmsys::ifstream fin(fetch_head.c_str(), std::ios::in | std::ios::binary);
     if (!fin) {
       this->Log << "Unable to open " << fetch_head << "\n";
       return false;
diff --git a/Source/CTest/cmCTestLaunch.cxx b/Source/CTest/cmCTestLaunch.cxx
index c03aa3a..99fa9e7 100644
--- a/Source/CTest/cmCTestLaunch.cxx
+++ b/Source/CTest/cmCTestLaunch.cxx
@@ -139,7 +139,7 @@ void cmCTestLaunch::HandleRealArg(const char* arg)
 #ifdef _WIN32
   // Expand response file arguments.
   if (arg[0] == '@' && cmSystemTools::FileExists(arg + 1)) {
-    std::ifstream fin(arg + 1);
+    cmsys::ifstream fin(arg + 1);
     std::string line;
     while (cmSystemTools::GetLineFromStream(fin, line)) {
       cmSystemTools::ParseWindowsCommandLine(line.c_str(), this->RealArgs);
@@ -203,8 +203,8 @@ void cmCTestLaunch::RunChild()
   cmsysProcess* cp = this->Process;
   cmsysProcess_SetCommand(cp, this->RealArgV);
 
-  std::ofstream fout;
-  std::ofstream ferr;
+  cmsys::ofstream fout;
+  cmsys::ofstream ferr;
   if (this->Passthru) {
     // In passthru mode we just share the output pipes.
     cmsysProcess_SetPipeShared(cp, cmsysProcess_Pipe_STDOUT, 1);
@@ -284,7 +284,7 @@ void cmCTestLaunch::LoadLabels()
   cmSystemTools::ConvertToUnixSlashes(source);
 
   // Load the labels file.
-  std::ifstream fin(fname.c_str(), std::ios::in | std::ios::binary);
+  cmsys::ifstream fin(fname.c_str(), std::ios::in | std::ios::binary);
   if (!fin) {
     return;
   }
@@ -487,7 +487,7 @@ void cmCTestLaunch::WriteXMLLabels(cmXMLWriter& xml)
 
 void cmCTestLaunch::DumpFileToXML(cmXMLWriter& xml, std::string const& fname)
 {
-  std::ifstream fin(fname.c_str(), std::ios::in | std::ios::binary);
+  cmsys::ifstream fin(fname.c_str(), std::ios::in | std::ios::binary);
 
   std::string line;
   const char* sep = "";
@@ -549,7 +549,7 @@ void cmCTestLaunch::LoadScrapeRules(
   fname += "Custom";
   fname += purpose;
   fname += ".txt";
-  std::ifstream fin(fname.c_str(), std::ios::in | std::ios::binary);
+  cmsys::ifstream fin(fname.c_str(), std::ios::in | std::ios::binary);
   std::string line;
   cmsys::RegularExpression rex;
   while (cmSystemTools::GetLineFromStream(fin, line)) {
@@ -565,7 +565,7 @@ bool cmCTestLaunch::ScrapeLog(std::string const& fname)
 
   // Look for log file lines matching warning expressions but not
   // suppression expressions.
-  std::ifstream fin(fname.c_str(), std::ios::in | std::ios::binary);
+  cmsys::ifstream fin(fname.c_str(), std::ios::in | std::ios::binary);
   std::string line;
   while (cmSystemTools::GetLineFromStream(fin, line)) {
     if (MatchesFilterPrefix(line)) {
diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx 
b/Source/CTest/cmCTestMemCheckHandler.cxx
index 3d212f9..5f70f66 100644
--- a/Source/CTest/cmCTestMemCheckHandler.cxx
+++ b/Source/CTest/cmCTestMemCheckHandler.cxx
@@ -988,7 +988,7 @@ void cmCTestMemCheckHandler::PostProcessBoundsCheckerTest(
   }
   // put a scope around this to close ifs so the file can be removed
   {
-    std::ifstream ifs(ofile.c_str());
+    cmsys::ifstream ifs(ofile.c_str());
     if (!ifs) {
       std::string log = "Cannot read memory tester output file: " + ofile;
       cmCTestLog(this->CTest, ERROR_MESSAGE, log << std::endl);
@@ -1021,7 +1021,7 @@ void 
cmCTestMemCheckHandler::AppendMemTesterOutput(cmCTestTestResult& res,
   }
   // put ifs in scope so file can be deleted if needed
   {
-    std::ifstream ifs(ofile.c_str());
+    cmsys::ifstream ifs(ofile.c_str());
     if (!ifs) {
       std::string log = "Cannot read memory tester output file: " + ofile;
       cmCTestLog(this->CTest, ERROR_MESSAGE, log << std::endl);
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx 
b/Source/CTest/cmCTestMultiProcessHandler.cxx
index a996af8..ae97d32 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -402,13 +402,13 @@ void cmCTestMultiProcessHandler::UpdateCostData()
 {
   std::string fname = this->CTest->GetCostDataFile();
   std::string tmpout = fname + ".tmp";
-  std::ofstream fout;
+  cmsys::ofstream fout;
   fout.open(tmpout.c_str());
 
   PropertiesMap temp = this->Properties;
 
   if (cmSystemTools::FileExists(fname.c_str())) {
-    std::ifstream fin;
+    cmsys::ifstream fin;
     fin.open(fname.c_str());
 
     std::string line;
@@ -462,7 +462,7 @@ void cmCTestMultiProcessHandler::ReadCostData()
   std::string fname = this->CTest->GetCostDataFile();
 
   if (cmSystemTools::FileExists(fname.c_str(), true)) {
-    std::ifstream fin;
+    cmsys::ifstream fin;
     fin.open(fname.c_str());
     std::string line;
     while (std::getline(fin, line)) {
@@ -651,7 +651,7 @@ void cmCTestMultiProcessHandler::WriteCheckpoint(int index)
 {
   std::string fname =
     this->CTest->GetBinaryDir() + "/Testing/Temporary/CTestCheckpoint.txt";
-  std::ofstream fout;
+  cmsys::ofstream fout;
   fout.open(fname.c_str(), std::ios::app);
   fout << index << "\n";
   fout.close();
@@ -759,7 +759,7 @@ void cmCTestMultiProcessHandler::CheckResume()
         << "----------------------------------------------------------"
         << std::endl;
 
-      std::ifstream fin;
+      cmsys::ifstream fin;
       fin.open(fname.c_str());
       std::string line;
       while (std::getline(fin, line)) {
diff --git a/Source/CTest/cmCTestTestHandler.cxx 
b/Source/CTest/cmCTestTestHandler.cxx
index 4a9461b..96a22d9 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -1533,7 +1533,7 @@ void 
cmCTestTestHandler::ExpandTestsToRunInformationForRerunFailed()
   }
 
   // parse the list of tests to rerun from LastTestsFailed.log
-  std::ifstream ifs(lastTestsFailedLog.c_str());
+  cmsys::ifstream ifs(lastTestsFailedLog.c_str());
   if (ifs) {
     std::string line;
     std::string::size_type pos;
@@ -1658,7 +1658,7 @@ void 
cmCTestTestHandler::GenerateRegressionImages(cmXMLWriter& xml,
           xml.Element("Value", "Image " + filename + " is empty");
           xml.EndElement();
         } else {
-          std::ifstream ifs(filename.c_str(), std::ios::in
+          cmsys::ifstream ifs(filename.c_str(), std::ios::in
 #ifdef _WIN32
                                 | std::ios::binary
 #endif
@@ -1730,7 +1730,7 @@ void cmCTestTestHandler::SetTestsToRunInformation(const 
char* in)
   // if the argument is a file, then read it and use the contents as the
   // string
   if (cmSystemTools::FileExists(in)) {
-    std::ifstream fin(in);
+    cmsys::ifstream fin(in);
     unsigned long filelen = cmSystemTools::FileLength(in);
     char* buff = new char[filelen + 1];
     fin.getline(buff, filelen);
diff --git a/Source/CTest/cmParseBlanketJSCoverage.cxx 
b/Source/CTest/cmParseBlanketJSCoverage.cxx
index 4bc4cd2..fa539e4 100644
--- a/Source/CTest/cmParseBlanketJSCoverage.cxx
+++ b/Source/CTest/cmParseBlanketJSCoverage.cxx
@@ -55,7 +55,7 @@ public:
     std::string covResult;
     std::string line;
 
-    std::ifstream in(file.c_str());
+    cmsys::ifstream in(file.c_str());
     if (!in) {
       return false;
     }
diff --git a/Source/CTest/cmParseCacheCoverage.cxx 
b/Source/CTest/cmParseCacheCoverage.cxx
index dac93a4..0916da2 100644
--- a/Source/CTest/cmParseCacheCoverage.cxx
+++ b/Source/CTest/cmParseCacheCoverage.cxx
@@ -90,7 +90,7 @@ bool 
cmParseCacheCoverage::SplitString(std::vector<std::string>& args,
 
 bool cmParseCacheCoverage::ReadCMCovFile(const char* file)
 {
-  std::ifstream in(file);
+  cmsys::ifstream in(file);
   if (!in) {
     cmCTestLog(this->CTest, ERROR_MESSAGE, "Can not open : " << file << "\n");
     return false;
diff --git a/Source/CTest/cmParseCoberturaCoverage.cxx 
b/Source/CTest/cmParseCoberturaCoverage.cxx
index 1f5db65..3bdae17 100644
--- a/Source/CTest/cmParseCoberturaCoverage.cxx
+++ b/Source/CTest/cmParseCoberturaCoverage.cxx
@@ -86,7 +86,7 @@ protected:
             }
           }
 
-          std::ifstream fin(this->CurFileName.c_str());
+          cmsys::ifstream fin(this->CurFileName.c_str());
           if (this->CurFileName == "" || !fin) {
             this->CurFileName =
               this->Coverage.BinaryDir + "/" + atts[tagCount + 1];
diff --git a/Source/CTest/cmParseDelphiCoverage.cxx 
b/Source/CTest/cmParseDelphiCoverage.cxx
index 98405ca..9d86ce9 100644
--- a/Source/CTest/cmParseDelphiCoverage.cxx
+++ b/Source/CTest/cmParseDelphiCoverage.cxx
@@ -31,7 +31,7 @@ public:
     bool blockComFlag = false;
     bool lineComFlag = false;
     std::vector<std::string> beginSet;
-    std::ifstream in(filename.c_str());
+    cmsys::ifstream in(filename.c_str());
     if (!in) {
       return false;
     }
@@ -148,7 +148,7 @@ public:
 
     this->initializeDelphiFile(files[0], coverageVector);
 
-    std::ifstream in(file);
+    cmsys::ifstream in(file);
     if (!in) {
       return false;
     }
diff --git a/Source/CTest/cmParseGTMCoverage.cxx 
b/Source/CTest/cmParseGTMCoverage.cxx
index 63c378c..33ad839 100644
--- a/Source/CTest/cmParseGTMCoverage.cxx
+++ b/Source/CTest/cmParseGTMCoverage.cxx
@@ -41,7 +41,7 @@ bool cmParseGTMCoverage::LoadCoverageData(const char* d)
 
 bool cmParseGTMCoverage::ReadMCovFile(const char* file)
 {
-  std::ifstream in(file);
+  cmsys::ifstream in(file);
   if (!in) {
     return false;
   }
@@ -114,7 +114,7 @@ bool 
cmParseGTMCoverage::FindFunctionInMumpsFile(std::string const& filepath,
                                                  std::string const& function,
                                                  int& lineoffset)
 {
-  std::ifstream in(filepath.c_str());
+  cmsys::ifstream in(filepath.c_str());
   if (!in) {
     return false;
   }
diff --git a/Source/CTest/cmParseJacocoCoverage.cxx 
b/Source/CTest/cmParseJacocoCoverage.cxx
index 1af0672..e456f39 100644
--- a/Source/CTest/cmParseJacocoCoverage.cxx
+++ b/Source/CTest/cmParseJacocoCoverage.cxx
@@ -47,7 +47,7 @@ protected:
                          this->Coverage.Quiet);
 
       this->FilePath = this->PackagePath + "/" + fileName;
-      std::ifstream fin(this->FilePath.c_str());
+      cmsys::ifstream fin(this->FilePath.c_str());
       if (!fin) {
         cmCTestLog(this->CTest, ERROR_MESSAGE,
                    "Jacoco Coverage: Error opening " << this->FilePath
diff --git a/Source/CTest/cmParseMumpsCoverage.cxx 
b/Source/CTest/cmParseMumpsCoverage.cxx
index 3011462..e5dd74a 100644
--- a/Source/CTest/cmParseMumpsCoverage.cxx
+++ b/Source/CTest/cmParseMumpsCoverage.cxx
@@ -23,7 +23,7 @@ bool cmParseMumpsCoverage::ReadCoverageFile(const char* file)
   // Read the gtm_coverage.mcov file, that has two lines of data:
   // packages:/full/path/to/Vista/Packages
   // coverage_dir:/full/path/to/dir/with/*.mcov
-  std::ifstream in(file);
+  cmsys::ifstream in(file);
   if (!in) {
     return false;
   }
@@ -54,7 +54,7 @@ bool cmParseMumpsCoverage::ReadCoverageFile(const char* file)
 void cmParseMumpsCoverage::InitializeMumpsFile(std::string& file)
 {
   // initialize the coverage information for a given mumps file
-  std::ifstream in(file.c_str());
+  cmsys::ifstream in(file.c_str());
   if (!in) {
     return;
   }
diff --git a/Source/CTest/cmParsePHPCoverage.cxx 
b/Source/CTest/cmParsePHPCoverage.cxx
index e2c2d98..5ec2718 100644
--- a/Source/CTest/cmParsePHPCoverage.cxx
+++ b/Source/CTest/cmParsePHPCoverage.cxx
@@ -165,7 +165,7 @@ bool cmParsePHPCoverage::ReadFileInformation(std::istream& 
in)
 
 bool cmParsePHPCoverage::ReadPHPData(const char* file)
 {
-  std::ifstream in(file);
+  cmsys::ifstream in(file);
   if (!in) {
     return false;
   }
diff --git a/Source/CursesDialog/cmCursesForm.cxx 
b/Source/CursesDialog/cmCursesForm.cxx
index 8183aa7..aa4710f 100644
--- a/Source/CursesDialog/cmCursesForm.cxx
+++ b/Source/CursesDialog/cmCursesForm.cxx
@@ -11,7 +11,7 @@
 ============================================================================*/
 #include "cmCursesForm.h"
 
-std::ofstream cmCursesForm::DebugFile;
+cmsys::ofstream cmCursesForm::DebugFile;
 bool cmCursesForm::Debug = false;
 
 cmCursesForm::cmCursesForm()
diff --git a/Source/CursesDialog/cmCursesForm.h 
b/Source/CursesDialog/cmCursesForm.h
index d32f0f3..c0192fc 100644
--- a/Source/CursesDialog/cmCursesForm.h
+++ b/Source/CursesDialog/cmCursesForm.h
@@ -59,7 +59,7 @@ public:
   static cmCursesForm* CurrentForm;
 
 protected:
-  static std::ofstream DebugFile;
+  static cmsys::ofstream DebugFile;
   static bool Debug;
 
   cmCursesForm(const cmCursesForm& form);
diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx
index 30645ef..235cf88 100644
--- a/Source/cmArchiveWrite.cxx
+++ b/Source/cmArchiveWrite.cxx
@@ -299,7 +299,7 @@ bool cmArchiveWrite::AddFile(const char* file, size_t skip, 
const char* prefix)
 
 bool cmArchiveWrite::AddData(const char* file, size_t size)
 {
-  std::ifstream fin(file, std::ios::in | std::ios::binary);
+  cmsys::ifstream fin(file, std::ios::in | std::ios::binary);
   if (!fin) {
     this->Error = "Error opening \"";
     this->Error += file;
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index da11894..2e47298 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -511,7 +511,7 @@ int cmCTest::Initialize(const char* binary_dir, 
cmCTestStartCommand* command)
     }
 
     std::string tagfile = testingDir + "/TAG";
-    std::ifstream tfin(tagfile.c_str());
+    cmsys::ifstream tfin(tagfile.c_str());
     std::string tag;
 
     if (createNewTag) {
@@ -556,7 +556,7 @@ int cmCTest::Initialize(const char* binary_dir, 
cmCTestStartCommand* command)
                 lctime->tm_mon + 1, lctime->tm_mday, lctime->tm_hour,
                 lctime->tm_min);
         tag = datestring;
-        std::ofstream ofs(tagfile.c_str());
+        cmsys::ofstream ofs(tagfile.c_str());
         if (ofs) {
           ofs << tag << std::endl;
           ofs << this->GetTestModelString() << std::endl;
@@ -696,7 +696,7 @@ bool cmCTest::UpdateCTestConfiguration()
     cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, "Parse Config file:" << fileName
                                                                   << "\n");
     // parse the dart test file
-    std::ifstream fin(fileName.c_str());
+    cmsys::ifstream fin(fileName.c_str());
 
     if (!fin) {
       return false;
@@ -1429,7 +1429,7 @@ int cmCTest::GenerateCTestNotesOutput(cmXMLWriter& xml,
     xml.Element("Time", cmSystemTools::GetTime());
     xml.Element("DateTime", note_time);
     xml.StartElement("Text");
-    std::ifstream ifs(it->c_str());
+    cmsys::ifstream ifs(it->c_str());
     if (ifs) {
       std::string line;
       while (cmSystemTools::GetLineFromStream(ifs, line)) {
@@ -1502,7 +1502,7 @@ std::string cmCTest::Base64GzipEncodeFile(std::string 
const& file)
 std::string cmCTest::Base64EncodeFile(std::string const& file)
 {
   size_t const len = cmSystemTools::FileLength(file);
-  std::ifstream ifs(file.c_str(), std::ios::in
+  cmsys::ifstream ifs(file.c_str(), std::ios::in
 #ifdef _WIN32
                         | std::ios::binary
 #endif
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx
index f88c48b..bcef3c8 100644
--- a/Source/cmCacheManager.cxx
+++ b/Source/cmCacheManager.cxx
@@ -53,7 +53,7 @@ bool cmCacheManager::LoadCache(const std::string& path, bool 
internal,
     return false;
   }
 
-  std::ifstream fin(cacheFile.c_str());
+  cmsys::ifstream fin(cacheFile.c_str());
   if (!fin) {
     return false;
   }
@@ -360,7 +360,7 @@ bool cmCacheManager::SaveCache(const std::string& path)
   checkCacheFile += cmake::GetCMakeFilesDirectory();
   cmSystemTools::MakeDirectory(checkCacheFile.c_str());
   checkCacheFile += "/cmake.check_cache";
-  std::ofstream checkCache(checkCacheFile.c_str());
+  cmsys::ofstream checkCache(checkCacheFile.c_str());
   if (!checkCache) {
     cmSystemTools::Error("Unable to open check cache file for write. ",
                          checkCacheFile.c_str());
diff --git a/Source/cmCryptoHash.cxx b/Source/cmCryptoHash.cxx
index b0338d5..85049ca 100644
--- a/Source/cmCryptoHash.cxx
+++ b/Source/cmCryptoHash.cxx
@@ -44,7 +44,7 @@ std::string cmCryptoHash::HashString(const std::string& input)
 
 std::string cmCryptoHash::HashFile(const std::string& file)
 {
-  std::ifstream fin(file.c_str(), std::ios::in | std::ios::binary);
+  cmsys::ifstream fin(file.c_str(), std::ios::in | std::ios::binary);
   if (!fin) {
     return "";
   }
diff --git a/Source/cmDepends.cxx b/Source/cmDepends.cxx
index 1ade4db..5df3cc1 100644
--- a/Source/cmDepends.cxx
+++ b/Source/cmDepends.cxx
@@ -91,7 +91,7 @@ bool cmDepends::Check(const char* makeFile, const char* 
internalFile,
 
   // Check whether dependencies must be regenerated.
   bool okay = true;
-  std::ifstream fin(internalFile);
+  cmsys::ifstream fin(internalFile);
   if (!(fin && this->CheckDependencies(fin, internalFile, validDeps))) {
     // Clear all dependencies so they will be regenerated.
     this->Clear(makeFile);
diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx
index 87abd42..57e719c 100644
--- a/Source/cmDependsC.cxx
+++ b/Source/cmDependsC.cxx
@@ -211,7 +211,7 @@ bool cmDependsC::WriteDependencies(const 
std::set<std::string>& sources,
 
           // Try to scan the file.  Just leave it out if we cannot find
           // it.
-          std::ifstream fin(fullName.c_str());
+          cmsys::ifstream fin(fullName.c_str());
           if (fin) {
             cmsys::FStream::BOM bom = cmsys::FStream::ReadBOM(fin);
             if (bom == cmsys::FStream::BOM_None ||
@@ -263,7 +263,7 @@ void cmDependsC::ReadCacheFile()
   if (this->CacheFileName.empty()) {
     return;
   }
-  std::ifstream fin(this->CacheFileName.c_str());
+  cmsys::ifstream fin(this->CacheFileName.c_str());
   if (!fin) {
     return;
   }
@@ -330,7 +330,7 @@ void cmDependsC::WriteCacheFile() const
   if (this->CacheFileName.empty()) {
     return;
   }
-  std::ofstream cacheOut(this->CacheFileName.c_str());
+  cmsys::ofstream cacheOut(this->CacheFileName.c_str());
   if (!cacheOut) {
     return;
   }
diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx
index 16c6f7b..a20fb98 100644
--- a/Source/cmDependsFortran.cxx
+++ b/Source/cmDependsFortran.cxx
@@ -246,7 +246,7 @@ void cmDependsFortran::LocateModules()
        i != infoFiles.end(); ++i) {
     std::string targetDir = cmSystemTools::GetFilenamePath(*i);
     std::string fname = targetDir + "/fortran.internal";
-    std::ifstream fin(fname.c_str());
+    cmsys::ifstream fin(fname.c_str());
     if (fin) {
       this->MatchRemoteModules(fin, targetDir.c_str());
     }
@@ -630,11 +630,11 @@ bool cmDependsFortran::ModulesDiffer(const char* modFile,
   }
 
 #if defined(_WIN32) || defined(__CYGWIN__)
-  std::ifstream finModFile(modFile, std::ios::in | std::ios::binary);
-  std::ifstream finStampFile(stampFile, std::ios::in | std::ios::binary);
+  cmsys::ifstream finModFile(modFile, std::ios::in | std::ios::binary);
+  cmsys::ifstream finStampFile(stampFile, std::ios::in | std::ios::binary);
 #else
-  std::ifstream finModFile(modFile);
-  std::ifstream finStampFile(stampFile);
+  cmsys::ifstream finModFile(modFile, std::ios::in);
+  cmsys::ifstream finStampFile(stampFile, std::ios::in);
 #endif
   if (!finModFile || !finStampFile) {
     // At least one of the files does not exist.  The modules differ.
diff --git a/Source/cmDependsJavaParserHelper.cxx 
b/Source/cmDependsJavaParserHelper.cxx
index 94c8ac0..bd3ee4d 100644
--- a/Source/cmDependsJavaParserHelper.cxx
+++ b/Source/cmDependsJavaParserHelper.cxx
@@ -345,7 +345,7 @@ int cmDependsJavaParserHelper::ParseFile(const char* file)
   if (!cmSystemTools::FileExists(file)) {
     return 0;
   }
-  std::ifstream ifs(file);
+  cmsys::ifstream ifs(file);
   if (!ifs) {
     return 0;
   }
diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx
index 2bd0af7..68a8488 100644
--- a/Source/cmDocumentation.cxx
+++ b/Source/cmDocumentation.cxx
@@ -137,10 +137,10 @@ bool 
cmDocumentation::PrintRequestedDocumentation(std::ostream& os)
     this->CurrentArgument = i->Argument;
     // If a file name was given, use it.  Otherwise, default to the
     // given stream.
-    std::ofstream* fout = 0;
+    cmsys::ofstream* fout = 0;
     std::ostream* s = &os;
     if (!i->Filename.empty()) {
-      fout = new std::ofstream(i->Filename.c_str());
+      fout = new cmsys::ofstream(i->Filename.c_str(), std::ios::out);
       if (fout) {
         s = fout;
       } else {
@@ -509,7 +509,7 @@ void cmDocumentation::PrintNames(std::ostream& os, 
std::string const& pattern)
   for (std::vector<std::string>::const_iterator i = files.begin();
        i != files.end(); ++i) {
     std::string line;
-    std::ifstream fin(i->c_str());
+    cmsys::ifstream fin(i->c_str());
     while (fin && cmSystemTools::GetLineFromStream(fin, line)) {
       if (!line.empty() && (isalnum(line[0]) || line[0] == '<')) {
         names.push_back(line);
diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx
index 3b5c04a..c7f8a2d 100644
--- a/Source/cmELF.cxx
+++ b/Source/cmELF.cxx
@@ -107,7 +107,7 @@ public:
   };
 
   // Construct and take ownership of the file stream object.
-  cmELFInternal(cmELF* external, cmsys::auto_ptr<std::ifstream>& fin,
+  cmELFInternal(cmELF* external, cmsys::auto_ptr<cmsys::ifstream>& fin,
                 ByteOrderType order)
     : External(external)
     , Stream(*fin.release())
@@ -237,7 +237,7 @@ public:
   typedef typename Types::tagtype tagtype;
 
   // Construct with a stream and byte swap indicator.
-  cmELFInternalImpl(cmELF* external, cmsys::auto_ptr<std::ifstream>& fin,
+  cmELFInternalImpl(cmELF* external, cmsys::auto_ptr<cmsys::ifstream>& fin,
                     ByteOrderType order);
 
   // Return the number of sections as specified by the ELF header.
@@ -538,7 +538,7 @@ private:
 
 template <class Types>
 cmELFInternalImpl<Types>::cmELFInternalImpl(
-  cmELF* external, cmsys::auto_ptr<std::ifstream>& fin, ByteOrderType order)
+  cmELF* external, cmsys::auto_ptr<cmsys::ifstream>& fin, ByteOrderType order)
   : cmELFInternal(external, fin, order)
 {
   // Read the main header.
@@ -755,7 +755,7 @@ cmELF::cmELF(const char* fname)
   : Internal(0)
 {
   // Try to open the file.
-  cmsys::auto_ptr<std::ifstream> fin(new std::ifstream(fname));
+  cmsys::auto_ptr<cmsys::ifstream> fin(new cmsys::ifstream(fname));
 
   // Quit now if the file could not be opened.
   if (!fin.get() || !*fin) {
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index 40357e8..736c7da 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -69,11 +69,11 @@ const char* cmExportFileGenerator::GetMainExportFileName() 
const
 bool cmExportFileGenerator::GenerateImportFile()
 {
   // Open the output file to generate it.
-  cmsys::auto_ptr<std::ofstream> foutPtr;
+  cmsys::auto_ptr<cmsys::ofstream> foutPtr;
   if (this->AppendMode) {
     // Open for append.
-    cmsys::auto_ptr<std::ofstream> ap(
-      new std::ofstream(this->MainImportFile.c_str(), std::ios::app));
+    cmsys::auto_ptr<cmsys::ofstream> ap(
+      new cmsys::ofstream(this->MainImportFile.c_str(), std::ios::app));
     foutPtr = ap;
   } else {
     // Generate atomically and with copy-if-different.
diff --git a/Source/cmExportLibraryDependenciesCommand.cxx 
b/Source/cmExportLibraryDependenciesCommand.cxx
index 79558e3..ab43aa8 100644
--- a/Source/cmExportLibraryDependenciesCommand.cxx
+++ b/Source/cmExportLibraryDependenciesCommand.cxx
@@ -53,10 +53,10 @@ void cmExportLibraryDependenciesCommand::FinalPass()
 void cmExportLibraryDependenciesCommand::ConstFinalPass() const
 {
   // Use copy-if-different if not appending.
-  cmsys::auto_ptr<std::ofstream> foutPtr;
+  cmsys::auto_ptr<cmsys::ofstream> foutPtr;
   if (this->Append) {
-    cmsys::auto_ptr<std::ofstream> ap(
-      new std::ofstream(this->Filename.c_str(), std::ios::app));
+    cmsys::auto_ptr<cmsys::ofstream> ap(
+      new cmsys::ofstream(this->Filename.c_str(), std::ios::app));
     foutPtr = ap;
   } else {
     cmsys::auto_ptr<cmGeneratedFileStream> ap(
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 889aefb..4e72f36 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -200,7 +200,7 @@ bool 
cmFileCommand::HandleWriteCommand(std::vector<std::string> const& args,
   }
   // If GetPermissions fails, pretend like it is ok. File open will fail if
   // the file is not writable
-  std::ofstream file(fileName.c_str(),
+  cmsys::ofstream file(fileName.c_str(),
                        append ? std::ios::app : std::ios::out);
   if (!file) {
     std::string error = "failed to open for writing (";
@@ -253,11 +253,11 @@ bool 
cmFileCommand::HandleReadCommand(std::vector<std::string> const& args)
 
 // Open the specified file.
 #if defined(_WIN32) || defined(__CYGWIN__)
-  std::ifstream file(
+  cmsys::ifstream file(
     fileName.c_str(), std::ios::in |
       (hexOutputArg.IsEnabled() ? std::ios::binary : std::ios::in));
 #else
-  std::ifstream file(fileName.c_str());
+  cmsys::ifstream file(fileName.c_str(), std::ios::in);
 #endif
 
   if (!file) {
@@ -524,9 +524,9 @@ bool 
cmFileCommand::HandleStringsCommand(std::vector<std::string> const& args)
 
 // Open the specified file.
 #if defined(_WIN32) || defined(__CYGWIN__)
-  std::ifstream fin(fileName.c_str(), std::ios::in | std::ios::binary);
+  cmsys::ifstream fin(fileName.c_str(), std::ios::in | std::ios::binary);
 #else
-  std::ifstream fin(fileName.c_str());
+  cmsys::ifstream fin(fileName.c_str(), std::ios::in);
 #endif
   if (!fin) {
     std::ostringstream e;
@@ -2292,7 +2292,7 @@ namespace {
 size_t cmWriteToFileCallback(void* ptr, size_t size, size_t nmemb, void* data)
 {
   int realsize = (int)(size * nmemb);
-  std::ofstream* fout = static_cast<std::ofstream*>(data);
+  cmsys::ofstream* fout = static_cast<cmsys::ofstream*>(data);
   const char* chPtr = static_cast<char*>(ptr);
   fout->write(chPtr, realsize);
   return realsize;
@@ -2598,7 +2598,7 @@ bool 
cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args)
     return false;
   }
 
-  std::ofstream fout(file.c_str(), std::ios::binary);
+  cmsys::ofstream fout(file.c_str(), std::ios::binary);
   if (!fout) {
     this->SetError("DOWNLOAD cannot open file for write.");
     return false;
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 6504b2f..1a44d73 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -1218,7 +1218,7 @@ void 
cmFindPackageCommand::LoadPackageRegistryDir(std::string const& dir,
       cmFindPackageCommandHoldFile holdFile(fname.c_str());
 
       // Load the file.
-      std::ifstream fin(fname.c_str(), std::ios::in | std::ios::binary);
+      cmsys::ifstream fin(fname.c_str(), std::ios::in | std::ios::binary);
       std::string fentry;
       if (fin && cmSystemTools::GetLineFromStream(fin, fentry) &&
           this->CheckPackageRegistryEntry(fentry, outPaths)) {
diff --git a/Source/cmGeneratedFileStream.cxx b/Source/cmGeneratedFileStream.cxx
index c35a1bc..dee174b 100644
--- a/Source/cmGeneratedFileStream.cxx
+++ b/Source/cmGeneratedFileStream.cxx
@@ -56,7 +56,7 @@ cmGeneratedFileStream& cmGeneratedFileStream::Open(const 
char* name,
     this->Stream::open(this->TempName.c_str(),
                        std::ios::out | std::ios::binary);
   } else {
-    this->Stream::open(this->TempName.c_str());
+    this->Stream::open(this->TempName.c_str(), std::ios::out);
   }
 
   // Check if the file opened.
diff --git a/Source/cmGeneratedFileStream.h b/Source/cmGeneratedFileStream.h
index 9836aa7..a2de5bc 100644
--- a/Source/cmGeneratedFileStream.h
+++ b/Source/cmGeneratedFileStream.h
@@ -75,10 +75,10 @@ protected:
  * being updated.
  */
 class cmGeneratedFileStream : private cmGeneratedFileStreamBase,
-                              public std::ofstream
+                              public cmsys::ofstream
 {
 public:
-  typedef std::ofstream Stream;
+  typedef cmsys::ofstream Stream;
 
   /**
    * This constructor prepares a default stream.  The open method must
diff --git a/Source/cmGeneratorExpressionEvaluationFile.cxx 
b/Source/cmGeneratorExpressionEvaluationFile.cxx
index 5b85d0c..5b48eea 100644
--- a/Source/cmGeneratorExpressionEvaluationFile.cxx
+++ b/Source/cmGeneratorExpressionEvaluationFile.cxx
@@ -116,7 +116,7 @@ void 
cmGeneratorExpressionEvaluationFile::Generate(cmLocalGenerator* lg)
   } else {
     lg->GetMakefile()->AddCMakeDependFile(this->Input);
     cmSystemTools::GetPermissions(this->Input.c_str(), perm);
-    std::ifstream fin(this->Input.c_str());
+    cmsys::ifstream fin(this->Input.c_str());
     if (!fin) {
       std::ostringstream e;
       e << "Evaluation file \"" << this->Input << "\" cannot be read.";
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 49524cc..aef3f44 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -2569,9 +2569,9 @@ void cmGlobalGenerator::CheckRuleHashes(std::string 
const& pfile,
                                         std::string const& home)
 {
 #if defined(_WIN32) || defined(__CYGWIN__)
-  std::ifstream fin(pfile.c_str(), std::ios::in | std::ios::binary);
+  cmsys::ifstream fin(pfile.c_str(), std::ios::in | std::ios::binary);
 #else
-  std::ifstream fin(pfile.c_str());
+  cmsys::ifstream fin(pfile.c_str(), std::ios::in);
 #endif
   if (!fin) {
     return;
diff --git a/Source/cmGlobalKdevelopGenerator.cxx 
b/Source/cmGlobalKdevelopGenerator.cxx
index b73be5f..68a2538 100644
--- a/Source/cmGlobalKdevelopGenerator.cxx
+++ b/Source/cmGlobalKdevelopGenerator.cxx
@@ -175,7 +175,7 @@ bool cmGlobalKdevelopGenerator::CreateFilelistFile(
 
   // check if the output file already exists and read it
   // insert all files which exist into the set of files
-  std::ifstream oldFilelist(filename.c_str());
+  cmsys::ifstream oldFilelist(filename.c_str());
   if (oldFilelist) {
     while (cmSystemTools::GetLineFromStream(oldFilelist, tmp)) {
       if (tmp[0] == '/') {
@@ -270,7 +270,7 @@ void cmGlobalKdevelopGenerator::MergeProjectFiles(
   const std::string& cmakeFilePattern, const std::string& fileToOpen,
   const std::string& sessionFilename)
 {
-  std::ifstream oldProjectFile(filename.c_str());
+  cmsys::ifstream oldProjectFile(filename.c_str());
   if (!oldProjectFile) {
     this->CreateNewProjectFile(outputDir, projectDir, filename, executable,
                                cmakeFilePattern, fileToOpen, sessionFilename);
diff --git a/Source/cmGlobalMSYSMakefileGenerator.cxx 
b/Source/cmGlobalMSYSMakefileGenerator.cxx
index 89c3c58..6bf178a 100644
--- a/Source/cmGlobalMSYSMakefileGenerator.cxx
+++ b/Source/cmGlobalMSYSMakefileGenerator.cxx
@@ -31,7 +31,7 @@ std::string cmGlobalMSYSMakefileGenerator::FindMinGW(
 {
   std::string fstab = makeloc;
   fstab += "/../etc/fstab";
-  std::ifstream fin(fstab.c_str());
+  cmsys::ifstream fin(fstab.c_str());
   std::string path;
   std::string mount;
   std::string mingwBin;
diff --git a/Source/cmGlobalNinjaGenerator.cxx 
b/Source/cmGlobalNinjaGenerator.cxx
index 3aec630..f74e835 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -513,8 +513,8 @@ void cmGlobalNinjaGenerator::Generate()
   this->WriteBuiltinTargets(*this->BuildFileStream);
 
   if (cmSystemTools::GetErrorOccuredFlag()) {
-    this->RulesFileStream->setstate(std::ios::failbit);
-    this->BuildFileStream->setstate(std::ios::failbit);
+    this->RulesFileStream->setstate(std::ios_base::failbit);
+    this->BuildFileStream->setstate(std::ios_base::failbit);
   }
 
   this->CloseCompileCommandsStream();
diff --git a/Source/cmLoadCacheCommand.cxx b/Source/cmLoadCacheCommand.cxx
index 9f70e87..85188d1 100644
--- a/Source/cmLoadCacheCommand.cxx
+++ b/Source/cmLoadCacheCommand.cxx
@@ -97,7 +97,7 @@ bool 
cmLoadCacheCommand::ReadWithPrefix(std::vector<std::string> const& args)
   this->VariablesToRead.insert(args.begin() + 3, args.end());
 
   // Read the cache file.
-  std::ifstream fin(cacheFile.c_str());
+  cmsys::ifstream fin(cacheFile.c_str());
 
   // This is a big hack read loop to overcome a buggy ifstream
   // implementation on HP-UX.  This should work on all platforms even
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx 
b/Source/cmLocalUnixMakefileGenerator3.cxx
index 56c167c..4b5af8b 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -1063,7 +1063,7 @@ void cmLocalUnixMakefileGenerator3::AppendCleanCommand(
   cleanfile += ".cmake";
   std::string cleanfilePath =
     this->Convert(cleanfile, cmOutputConverter::FULL);
-  std::ofstream fout(cleanfilePath.c_str());
+  cmsys::ofstream fout(cleanfilePath.c_str());
   if (!fout) {
     cmSystemTools::Error("Could not create ", cleanfilePath.c_str());
   }
diff --git a/Source/cmLocalVisualStudio7Generator.cxx 
b/Source/cmLocalVisualStudio7Generator.cxx
index bd47ab0..2f6bf07 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -183,7 +183,7 @@ void cmLocalVisualStudio7Generator::WriteStampFiles()
   cmSystemTools::MakeDirectory(stampName.c_str());
   stampName += "/";
   stampName += "generate.stamp";
-  std::ofstream stamp(stampName.c_str());
+  cmsys::ofstream stamp(stampName.c_str());
   stamp << "# CMake generation timestamp file for this directory.\n";
 
   // Create a helper file so CMake can determine when it is run
@@ -194,7 +194,7 @@ void cmLocalVisualStudio7Generator::WriteStampFiles()
   // the stamp file can just be touched.
   std::string depName = stampName;
   depName += ".depend";
-  std::ofstream depFile(depName.c_str());
+  cmsys::ofstream depFile(depName.c_str());
   depFile << "# CMake generation dependency list for this directory.\n";
   std::vector<std::string> const& listFiles = this->Makefile->GetListFiles();
   for (std::vector<std::string>::const_iterator lf = listFiles.begin();
@@ -1764,7 +1764,7 @@ void cmLocalVisualStudio7Generator::WriteCustomRule(
       // There are no real dependencies.  Produce an artificial one to
       // make sure the rule runs reliably.
       if (!cmSystemTools::FileExists(source)) {
-        std::ofstream depout(source);
+        cmsys::ofstream depout(source);
         depout << "Artificial dependency for a custom command.\n";
       }
       fout << this->ConvertToXMLOutputPath(source);
diff --git a/Source/cmMachO.cxx b/Source/cmMachO.cxx
index 990a30d..314760e 100644
--- a/Source/cmMachO.cxx
+++ b/Source/cmMachO.cxx
@@ -45,7 +45,7 @@ namespace {
 
 // peek in the file
 template <typename T>
-bool peek(std::ifstream& fin, T& v)
+bool peek(cmsys::ifstream& fin, T& v)
 {
   std::streampos p = fin.tellg();
   if (!fin.read(reinterpret_cast<char*>(&v), sizeof(T))) {
@@ -57,7 +57,7 @@ bool peek(std::ifstream& fin, T& v)
 
 // read from the file and fill a data structure
 template <typename T>
-bool read(std::ifstream& fin, T& v)
+bool read(cmsys::ifstream& fin, T& v)
 {
   if (!fin.read(reinterpret_cast<char*>(&v), sizeof(T))) {
     return false;
@@ -68,7 +68,7 @@ bool read(std::ifstream& fin, T& v)
 // read from the file and fill multiple data structures where
 // the vector has been resized
 template <typename T>
-bool read(std::ifstream& fin, std::vector<T>& v)
+bool read(cmsys::ifstream& fin, std::vector<T>& v)
 {
   // nothing to read
   if (v.empty()) {
@@ -106,7 +106,7 @@ public:
   }
   virtual ~cmMachOHeaderAndLoadCommands() {}
 
-  virtual bool read_mach_o(std::ifstream& fin) = 0;
+  virtual bool read_mach_o(cmsys::ifstream& fin) = 0;
 
   const std::vector<RawLoadCommand>& load_commands() const
   {
@@ -125,7 +125,7 @@ public:
 
 protected:
   bool read_load_commands(uint32_t ncmds, uint32_t sizeofcmds,
-                          std::ifstream& fin);
+                          cmsys::ifstream& fin);
 
   bool Swap;
   std::vector<RawLoadCommand> LoadCommands;
@@ -141,7 +141,7 @@ public:
     : cmMachOHeaderAndLoadCommands(_swap)
   {
   }
-  bool read_mach_o(std::ifstream& fin)
+  bool read_mach_o(cmsys::ifstream& fin)
   {
     if (!read(fin, this->Header)) {
       return false;
@@ -163,7 +163,7 @@ protected:
 
 bool cmMachOHeaderAndLoadCommands::read_load_commands(uint32_t ncmds,
                                                       uint32_t sizeofcmds,
-                                                      std::ifstream& fin)
+                                                      cmsys::ifstream& fin)
 {
   uint32_t size_read = 0;
   this->LoadCommands.resize(ncmds);
@@ -201,7 +201,7 @@ public:
   bool read_mach_o(uint32_t file_offset);
 
   // the file we are reading
-  std::ifstream Fin;
+  cmsys::ifstream Fin;
 
   // The archs in the universal binary
   // If the binary is not a universal binary, this will be empty.
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index e0e3ce5..c9192fd 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -3387,7 +3387,7 @@ int cmMakefile::ConfigureFile(const char* infile, const 
char* outfile,
     }
   } else {
     std::string newLineCharacters;
-    std::ios::openmode omode = std::ios::out | std::ios::trunc;
+    std::ios_base::openmode omode = std::ios_base::out | std::ios_base::trunc;
     if (newLine.IsValid()) {
       newLineCharacters = newLine.GetCharacters();
       omode |= std::ios::binary;
@@ -3396,14 +3396,14 @@ int cmMakefile::ConfigureFile(const char* infile, const 
char* outfile,
     }
     std::string tempOutputFile = soutfile;
     tempOutputFile += ".tmp";
-    std::ofstream fout(tempOutputFile.c_str(), omode);
+    cmsys::ofstream fout(tempOutputFile.c_str(), omode);
     if (!fout) {
       cmSystemTools::Error("Could not open file for write in copy operation ",
                            tempOutputFile.c_str());
       cmSystemTools::ReportLastSystemError("");
       return 0;
     }
-    std::ifstream fin(sinfile.c_str());
+    cmsys::ifstream fin(sinfile.c_str());
     if (!fin) {
       cmSystemTools::Error("Could not open file for read in copy operation ",
                            sinfile.c_str());
diff --git a/Source/cmOutputRequiredFilesCommand.cxx 
b/Source/cmOutputRequiredFilesCommand.cxx
index cc82558..29f1acc 100644
--- a/Source/cmOutputRequiredFilesCommand.cxx
+++ b/Source/cmOutputRequiredFilesCommand.cxx
@@ -166,7 +166,7 @@ protected:
 
   void DependWalk(cmDependInformation* info)
   {
-    std::ifstream fin(info->FullPath.c_str());
+    cmsys::ifstream fin(info->FullPath.c_str());
     if (!fin) {
       cmSystemTools::Error("error can not open ", info->FullPath.c_str());
       return;
diff --git a/Source/cmQtAutoGeneratorInitializer.cxx 
b/Source/cmQtAutoGeneratorInitializer.cxx
index f49c4c4..dd19760 100644
--- a/Source/cmQtAutoGeneratorInitializer.cxx
+++ b/Source/cmQtAutoGeneratorInitializer.cxx
@@ -463,7 +463,7 @@ static std::string cmQtAutoGeneratorsStripCR(std::string 
const& line)
 
 static std::string ReadAll(const std::string& filename)
 {
-  std::ifstream file(filename.c_str());
+  cmsys::ifstream file(filename.c_str());
   std::stringstream stream;
   stream << file.rdbuf();
   file.close();
@@ -960,7 +960,7 @@ void cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget(
   }
   if (!configDefines.empty() || !configIncludes.empty() ||
       !configUicOptions.empty()) {
-    std::ofstream infoFile(outputFile.c_str(), std::ios::app);
+    cmsys::ofstream infoFile(outputFile.c_str(), std::ios::app);
     if (!infoFile) {
       std::string error = "Internal CMake error when trying to open file: ";
       error += outputFile;
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index c77488b..dc44f3e 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -347,7 +347,7 @@ void cmQtAutoGenerators::WriteOldMocDefinitionsFile(
   cmSystemTools::ConvertToUnixSlashes(filename);
   filename += "/AutomocOldMocDefinitions.cmake";
 
-  std::ofstream outfile;
+  cmsys::ofstream outfile;
   outfile.open(filename.c_str(), std::ios::trunc);
   outfile << "set(AM_OLD_COMPILE_SETTINGS "
           << cmOutputConverter::EscapeForCMake(this->CurrentCompileSettingsStr)
@@ -431,7 +431,7 @@ void cmQtAutoGenerators::Init()
 
 static std::string ReadAll(const std::string& filename)
 {
-  std::ifstream file(filename.c_str());
+  cmsys::ifstream file(filename.c_str());
   std::stringstream stream;
   stream << file.rdbuf();
   file.close();
@@ -1053,7 +1053,7 @@ bool cmQtAutoGenerators::GenerateMocFiles(
                                      msg.c_str(), true, this->ColorOutput);
   }
   {
-    std::ofstream outfile;
+    cmsys::ofstream outfile;
     outfile.open(this->OutMocCppFilenameAbs.c_str(), std::ios::trunc);
     outfile << automocSource;
     outfile.close();
diff --git a/Source/cmRST.cxx b/Source/cmRST.cxx
index c4af23b..10d1cda 100644
--- a/Source/cmRST.cxx
+++ b/Source/cmRST.cxx
@@ -53,7 +53,7 @@ cmRST::cmRST(std::ostream& os, std::string const& docroot)
 
 bool cmRST::ProcessFile(std::string const& fname, bool isModule)
 {
-  std::ifstream fin(fname.c_str());
+  cmsys::ifstream fin(fname.c_str());
   if (fin) {
     this->DocDir = cmSystemTools::GetFilenamePath(fname);
     if (isModule) {
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 6bb65ee..26cbfb6 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -1349,7 +1349,7 @@ bool cmSystemTools::CreateTar(const char* outFileName,
 {
 #if defined(CMAKE_BUILD_WITH_CMAKE)
   std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
-  std::ofstream fout(outFileName, std::ios::out | std::ios::binary);
+  cmsys::ofstream fout(outFileName, std::ios::out | std::ios::binary);
   if (!fout) {
     std::string e = "Cannot open output file \"";
     e += outFileName;
@@ -1874,7 +1874,7 @@ unsigned int cmSystemTools::RandomSeed()
   } seed;
 
   // Try using a real random source.
-  std::ifstream fin;
+  cmsys::ifstream fin;
   fin.rdbuf()->pubsetbuf(0, 0); // Unbuffered read.
   fin.open("/dev/urandom");
   if (fin.good() && fin.read(seed.bytes, sizeof(seed)) &&
@@ -2002,7 +2002,7 @@ void cmSystemTools::FindCMakeResources(const char* argv0)
     // "<build>/CMakeFiles/CMakeSourceDir.txt".
     std::string dir = cmSystemTools::GetFilenamePath(exe_dir);
     std::string src_dir_txt = dir + "/CMakeFiles/CMakeSourceDir.txt";
-    std::ifstream fin(src_dir_txt.c_str());
+    cmsys::ifstream fin(src_dir_txt.c_str());
     std::string src_dir;
     if (fin && cmSystemTools::GetLineFromStream(fin, src_dir) &&
         cmSystemTools::FileIsDirectory(src_dir)) {
@@ -2010,7 +2010,7 @@ void cmSystemTools::FindCMakeResources(const char* argv0)
     } else {
       dir = cmSystemTools::GetFilenamePath(dir);
       src_dir_txt = dir + "/CMakeFiles/CMakeSourceDir.txt";
-      std::ifstream fin2(src_dir_txt.c_str());
+      cmsys::ifstream fin2(src_dir_txt.c_str());
       if (fin2 && cmSystemTools::GetLineFromStream(fin2, src_dir) &&
           cmSystemTools::FileIsDirectory(src_dir)) {
         cmSystemToolsCMakeRoot = src_dir;
@@ -2309,7 +2309,7 @@ bool cmSystemTools::ChangeRPath(std::string const& file,
 
   {
     // Open the file for update.
-    std::ofstream f(file.c_str(),
+    cmsys::ofstream f(file.c_str(),
                       std::ios::in | std::ios::out | std::ios::binary);
     if (!f) {
       if (emsg) {
@@ -2500,7 +2500,7 @@ bool cmSystemTools::RemoveRPath(std::string const& file, 
std::string* emsg,
   }
 
   // Open the file for update.
-  std::ofstream f(file.c_str(),
+  cmsys::ofstream f(file.c_str(),
                     std::ios::in | std::ios::out | std::ios::binary);
   if (!f) {
     if (emsg) {
diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx
index d140160..19837a7 100644
--- a/Source/cmTryRunCommand.cxx
+++ b/Source/cmTryRunCommand.cxx
@@ -277,7 +277,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& 
runArgs,
 
   if (error) {
     static bool firstTryRun = true;
-    std::ofstream file(resultFileName.c_str(),
+    cmsys::ofstream file(resultFileName.c_str(),
                          firstTryRun ? std::ios::out : std::ios::app);
     if (file) {
       if (firstTryRun) {
diff --git a/Source/cmUseMangledMesaCommand.cxx 
b/Source/cmUseMangledMesaCommand.cxx
index e08a8b9..1eb493a 100644
--- a/Source/cmUseMangledMesaCommand.cxx
+++ b/Source/cmUseMangledMesaCommand.cxx
@@ -71,14 +71,14 @@ void 
cmUseMangledMesaCommand::CopyAndFullPathMesaHeader(const char* source,
   outFile += file;
   std::string tempOutputFile = outFile;
   tempOutputFile += ".tmp";
-  std::ofstream fout(tempOutputFile.c_str());
+  cmsys::ofstream fout(tempOutputFile.c_str());
   if (!fout) {
     cmSystemTools::Error("Could not open file for write in copy operation: ",
                          tempOutputFile.c_str(), outdir);
     cmSystemTools::ReportLastSystemError("");
     return;
   }
-  std::ifstream fin(source);
+  cmsys::ifstream fin(source);
   if (!fin) {
     cmSystemTools::Error("Could not open file for read in copy operation",
                          source);
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx 
b/Source/cmVisualStudio10TargetGenerator.cxx
index 020622a..3b1cddb 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -816,7 +816,7 @@ void cmVisualStudio10TargetGenerator::WriteCustomRule(
       // Make sure the path exists for the file
       std::string path = cmSystemTools::GetFilenamePath(sourcePath);
       cmSystemTools::MakeDirectory(path.c_str());
-      std::ofstream fout(sourcePath.c_str());
+      cmsys::ofstream fout(sourcePath.c_str());
       if (fout) {
         fout << "# generated from CMake\n";
         fout.flush();
diff --git a/Source/cmVisualStudioSlnParser.cxx 
b/Source/cmVisualStudioSlnParser.cxx
index 2569d2c..7d7bb5b 100644
--- a/Source/cmVisualStudioSlnParser.cxx
+++ b/Source/cmVisualStudioSlnParser.cxx
@@ -431,7 +431,7 @@ bool cmVisualStudioSlnParser::ParseFile(const std::string& 
file,
     this->LastResult.SetError(ResultErrorUnsupportedDataGroup, 0);
     return false;
   }
-  std::ifstream f(file.c_str());
+  cmsys::ifstream f(file.c_str());
   if (!f) {
     this->LastResult.SetError(ResultErrorOpeningInput, 0);
     return false;
diff --git a/Source/cmWriteFileCommand.cxx b/Source/cmWriteFileCommand.cxx
index 74e0df0..3966d38 100644
--- a/Source/cmWriteFileCommand.cxx
+++ b/Source/cmWriteFileCommand.cxx
@@ -65,7 +65,7 @@ bool cmWriteFileCommand::InitialPass(std::vector<std::string> 
const& args,
   }
   // If GetPermissions fails, pretend like it is ok. File open will fail if
   // the file is not writable
-  std::ofstream file(fileName.c_str(),
+  cmsys::ofstream file(fileName.c_str(),
                        overwrite ? std::ios::out : std::ios::app);
   if (!file) {
     std::string error = "Internal CMake error when trying to open file: ";
diff --git a/Source/cmXMLParser.cxx b/Source/cmXMLParser.cxx
index 02cf7e1..5e06d36 100644
--- a/Source/cmXMLParser.cxx
+++ b/Source/cmXMLParser.cxx
@@ -43,7 +43,7 @@ int cmXMLParser::ParseFile(const char* file)
     return 0;
   }
 
-  std::ifstream ifs(file);
+  cmsys::ifstream ifs(file);
   if (!ifs) {
     return 0;
   }
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 1c79e74..e404fa3 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -1679,7 +1679,7 @@ void cmake::UpdateConversionPathTable()
     this->State->GetInitializedCacheValue("CMAKE_PATH_TRANSLATION_FILE");
 
   if (tablepath) {
-    std::ifstream table(tablepath);
+    cmsys::ifstream table(tablepath);
     if (!table) {
       cmSystemTools::Error("CMAKE_PATH_TRANSLATION_FILE set to ", tablepath,
                            ". CMake can not open file.");
@@ -2092,9 +2092,9 @@ static bool cmakeCheckStampFile(const char* stampName)
   std::string stampDepends = stampName;
   stampDepends += ".depend";
 #if defined(_WIN32) || defined(__CYGWIN__)
-  std::ifstream fin(stampDepends.c_str(), std::ios::in | std::ios::binary);
+  cmsys::ifstream fin(stampDepends.c_str(), std::ios::in | std::ios::binary);
 #else
-  std::ifstream fin(stampDepends.c_str());
+  cmsys::ifstream fin(stampDepends.c_str(), std::ios::in);
 #endif
   if (!fin) {
     // The stamp dependencies file cannot be read.  Just assume the
@@ -2132,7 +2132,7 @@ static bool cmakeCheckStampFile(const char* stampName)
   {
     // TODO: Teach cmGeneratedFileStream to use a random temp file (with
     // multiple tries in unlikely case of conflict) and use that here.
-    std::ofstream stamp(stampTemp);
+    cmsys::ofstream stamp(stampTemp);
     stamp << "# CMake generation timestamp file for this directory.\n";
   }
   if (cmSystemTools::RenameFile(stampTemp, stampName)) {
@@ -2157,7 +2157,7 @@ static bool cmakeCheckStampList(const char* stampList)
               << "is missing.\n";
     return false;
   }
-  std::ifstream fin(stampList);
+  cmsys::ifstream fin(stampList);
   if (!fin) {
     std::cout << "CMake is re-running because generate.stamp.list "
               << "could not be read.\n";
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index c3cd241..535dead 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -114,7 +114,7 @@ static bool cmTarFilesFrom(std::string const& file,
     cmSystemTools::Error(e.str().c_str());
     return false;
   }
-  std::ifstream fin(file.c_str());
+  cmsys::ifstream fin(file.c_str());
   if (!fin) {
     std::ostringstream e;
     e << "-E tar --files-from= file '" << file << "' not found";
@@ -239,7 +239,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& 
args)
                   << "\n";
         return 1;
       }
-      std::ifstream fin(args[3].c_str(), std::ios::in | std::ios::binary);
+      cmsys::ifstream fin(args[3].c_str(), std::ios::in | std::ios::binary);
       if (!fin) {
         std::cerr << "could not open object list file: " << args[3].c_str()
                   << "\n";
@@ -1102,7 +1102,7 @@ int cmcmd::ExecuteLinkScript(std::vector<std::string>& 
args)
   cmsysProcess_SetOption(cp, cmsysProcess_Option_Verbatim, 1);
 
   // Read command lines from the script.
-  std::ifstream fin(args[2].c_str());
+  cmsys::ifstream fin(args[2].c_str());
   if (!fin) {
     std::cerr << "Error opening link script \"" << args[2] << "\""
               << std::endl;
@@ -1228,7 +1228,7 @@ int cmcmd::VisualStudioLink(std::vector<std::string>& 
args, int type)
        ++i) {
     // check for nmake temporary files
     if ((*i)[0] == '@' && i->find("@CMakeFiles") != 0) {
-      std::ifstream fin(i->substr(1).c_str());
+      cmsys::ifstream fin(i->substr(1).c_str());
       std::string line;
       while (cmSystemTools::GetLineFromStream(fin, line)) {
         cmSystemTools::ParseWindowsCommandLine(line.c_str(), expandedArgs);
@@ -1407,7 +1407,7 @@ int cmVSLink::LinkIncremental()
     std::cout << "Create " << this->ManifestFileRC << "\n";
   }
   {
-    std::ofstream fout(this->ManifestFileRC.c_str());
+    cmsys::ofstream fout(this->ManifestFileRC.c_str());
     if (!fout) {
       return -1;
     }
@@ -1422,7 +1422,7 @@ int cmVSLink::LinkIncremental()
     if (this->Verbose) {
       std::cout << "Create empty: " << this->ManifestFile << "\n";
     }
-    std::ofstream foutTmp(this->ManifestFile.c_str());
+    cmsys::ofstream foutTmp(this->ManifestFile.c_str());
   }
 
   // Compile the resource file.
diff --git a/Tests/AliasTarget/commandgenerator.cpp 
b/Tests/AliasTarget/commandgenerator.cpp
index 57a9887..aaab014 100644
--- a/Tests/AliasTarget/commandgenerator.cpp
+++ b/Tests/AliasTarget/commandgenerator.cpp
@@ -6,7 +6,7 @@
 int main(int argc, char** argv)
 {
   std::fstream fout;
-  fout.open("commandoutput.h");
+  fout.open("commandoutput.h", std::ios::out);
   if (!fout)
     return 1;
   fout << "#define COMMANDOUTPUT_DEFINE\n";
diff --git a/Tests/AliasTarget/targetgenerator.cpp 
b/Tests/AliasTarget/targetgenerator.cpp
index 15cfc89..b3e6ee2 100644
--- a/Tests/AliasTarget/targetgenerator.cpp
+++ b/Tests/AliasTarget/targetgenerator.cpp
@@ -4,7 +4,7 @@
 int main(int argc, char** argv)
 {
   std::fstream fout;
-  fout.open("targetoutput.h");
+  fout.open("targetoutput.h", std::ios::out);
   if (!fout)
     return 1;
   fout << "#define TARGETOUTPUT_DEFINE\n";

-----------------------------------------------------------------------

Summary of changes:
 Source/CPack/OSXScriptLauncher.cxx             |    2 +-
 Source/CPack/WiX/cmCPackWIXGenerator.cxx       |    4 ++--
 Source/CPack/WiX/cmWIXRichTextFormatWriter.h   |    2 +-
 Source/CPack/WiX/cmWIXSourceWriter.h           |    2 +-
 Source/CPack/cmCPackDragNDropGenerator.cxx     |    8 ++++----
 Source/CPack/cmCPackGenerator.cxx              |    2 +-
 Source/CPack/cmCPackPackageMakerGenerator.cxx  |    4 ++--
 Source/CPack/cmCPackSTGZGenerator.cxx          |    4 ++--
 Source/CTest/cmCTestBatchTestHandler.cxx       |    2 +-
 Source/CTest/cmCTestCVS.cxx                    |    2 +-
 Source/CTest/cmCTestCoverageHandler.cxx        |   22 +++++++++++-----------
 Source/CTest/cmCTestGIT.cxx                    |    2 +-
 Source/CTest/cmCTestLaunch.cxx                 |   14 +++++++-------
 Source/CTest/cmCTestMemCheckHandler.cxx        |    4 ++--
 Source/CTest/cmCTestMultiProcessHandler.cxx    |   10 +++++-----
 Source/CTest/cmCTestTestHandler.cxx            |    6 +++---
 Source/CTest/cmParseBlanketJSCoverage.cxx      |    2 +-
 Source/CTest/cmParseCacheCoverage.cxx          |    2 +-
 Source/CTest/cmParseCoberturaCoverage.cxx      |    2 +-
 Source/CTest/cmParseDelphiCoverage.cxx         |    4 ++--
 Source/CTest/cmParseGTMCoverage.cxx            |    4 ++--
 Source/CTest/cmParseJacocoCoverage.cxx         |    2 +-
 Source/CTest/cmParseMumpsCoverage.cxx          |    4 ++--
 Source/CTest/cmParsePHPCoverage.cxx            |    2 +-
 Source/CursesDialog/cmCursesForm.cxx           |    2 +-
 Source/CursesDialog/cmCursesForm.h             |    2 +-
 Source/cmArchiveWrite.cxx                      |    2 +-
 Source/cmCTest.cxx                             |   10 +++++-----
 Source/cmCacheManager.cxx                      |    4 ++--
 Source/cmCryptoHash.cxx                        |    2 +-
 Source/cmDepends.cxx                           |    2 +-
 Source/cmDependsC.cxx                          |    6 +++---
 Source/cmDependsFortran.cxx                    |   10 +++++-----
 Source/cmDependsJavaParserHelper.cxx           |    2 +-
 Source/cmDocumentation.cxx                     |    6 +++---
 Source/cmELF.cxx                               |    8 ++++----
 Source/cmExportFileGenerator.cxx               |    6 +++---
 Source/cmExportLibraryDependenciesCommand.cxx  |    6 +++---
 Source/cmFileCommand.cxx                       |   14 +++++++-------
 Source/cmFindPackageCommand.cxx                |    2 +-
 Source/cmGeneratedFileStream.cxx               |    2 +-
 Source/cmGeneratedFileStream.h                 |    4 ++--
 Source/cmGeneratorExpressionEvaluationFile.cxx |    2 +-
 Source/cmGlobalGenerator.cxx                   |    4 ++--
 Source/cmGlobalKdevelopGenerator.cxx           |    4 ++--
 Source/cmGlobalMSYSMakefileGenerator.cxx       |    2 +-
 Source/cmGlobalNinjaGenerator.cxx              |    4 ++--
 Source/cmLoadCacheCommand.cxx                  |    2 +-
 Source/cmLocalUnixMakefileGenerator3.cxx       |    2 +-
 Source/cmLocalVisualStudio7Generator.cxx       |    6 +++---
 Source/cmMachO.cxx                             |   16 ++++++++--------
 Source/cmMakefile.cxx                          |    6 +++---
 Source/cmOutputRequiredFilesCommand.cxx        |    2 +-
 Source/cmQtAutoGeneratorInitializer.cxx        |    4 ++--
 Source/cmQtAutoGenerators.cxx                  |    6 +++---
 Source/cmRST.cxx                               |    2 +-
 Source/cmSystemTools.cxx                       |   12 ++++++------
 Source/cmTryRunCommand.cxx                     |    2 +-
 Source/cmUseMangledMesaCommand.cxx             |    4 ++--
 Source/cmVisualStudio10TargetGenerator.cxx     |    2 +-
 Source/cmVisualStudioSlnParser.cxx             |    2 +-
 Source/cmWriteFileCommand.cxx                  |    2 +-
 Source/cmXMLParser.cxx                         |    2 +-
 Source/cmake.cxx                               |   10 +++++-----
 Source/cmcmd.cxx                               |   12 ++++++------
 Tests/AliasTarget/commandgenerator.cpp         |    2 +-
 Tests/AliasTarget/targetgenerator.cpp          |    2 +-
 67 files changed, 158 insertions(+), 158 deletions(-)


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/mailman/listinfo/cmake-commits

Reply via email to