diff options
Diffstat (limited to 'Source/cmFileCommand.cxx')
-rw-r--r-- | Source/cmFileCommand.cxx | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 4446f72..311763b 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -32,6 +32,7 @@ #include <cmsys/Directory.hxx> #include <cmsys/Glob.hxx> #include <cmsys/RegularExpression.hxx> +#include <cmsys/FStream.hxx> // Table of permissions flags. #if defined(_WIN32) && !defined(__CYGWIN__) @@ -228,7 +229,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(), append?std::ios::app: std::ios::out); + cmsys::ofstream file(fileName.c_str(), append?std::ios::app: std::ios::out); if ( !file ) { std::string error = "Internal CMake error when trying to open file: "; @@ -283,10 +284,10 @@ bool cmFileCommand::HandleReadCommand(std::vector<std::string> const& args) // Open the specified file. #if defined(_WIN32) || defined(__CYGWIN__) - std::ifstream file(fileName.c_str(), std::ios::in | + cmsys::ifstream file(fileName.c_str(), std::ios::in | (hexOutputArg.IsEnabled() ? std::ios::binary : std::ios::in)); #else - std::ifstream file(fileName.c_str(), std::ios::in); + cmsys::ifstream file(fileName.c_str(), std::ios::in); #endif if ( !file ) @@ -577,9 +578,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(), std::ios::in); + cmsys::ifstream fin(fileName.c_str(), std::ios::in); #endif if(!fin) { @@ -2490,7 +2491,7 @@ namespace { 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; @@ -2838,7 +2839,7 @@ 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."); @@ -3094,7 +3095,7 @@ cmFileCommand::HandleUploadCommand(std::vector<std::string> const& args) // Open file for reading: // - FILE *fin = fopen(filename.c_str(), "rb"); + FILE *fin = cmsys::SystemTools::Fopen(filename.c_str(), "rb"); if(!fin) { std::string errStr = "UPLOAD cannot open file '"; |