diff options
Diffstat (limited to 'cpp/src/IcePatch2/Util.cpp')
-rw-r--r-- | cpp/src/IcePatch2/Util.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/cpp/src/IcePatch2/Util.cpp b/cpp/src/IcePatch2/Util.cpp index a46a94b68be..8e5c63dba4c 100644 --- a/cpp/src/IcePatch2/Util.cpp +++ b/cpp/src/IcePatch2/Util.cpp @@ -404,9 +404,9 @@ IcePatch2::rename(const string& fromPa, const string& toPa) const string fromPath = simplify(fromPa); const string toPath = simplify(toPa); - IceInternal::OS::remove(toPath); // We ignore errors, as the file we are renaming to might not exist. + OS::remove(toPath); // We ignore errors, as the file we are renaming to might not exist. - if(IceInternal::OS::rename(fromPath ,toPath) == -1) + if(OS::rename(fromPath ,toPath) == -1) { throw "cannot rename `" + fromPath + "' to `" + toPath + "': " + IceUtilInternal::lastErrorToString(); } @@ -425,7 +425,7 @@ IcePatch2::remove(const string& pa) if(S_ISDIR(buf.st_mode)) { - if(IceInternal::OS::rmdir(path) == -1) + if(OS::rmdir(path) == -1) { if(errno == EACCES) { @@ -436,7 +436,7 @@ IcePatch2::remove(const string& pa) } else { - if(IceInternal::OS::remove(path) == -1) + if(OS::remove(path) == -1) { throw "cannot remove file `" + path + "':\n" + IceUtilInternal::lastErrorToString(); } @@ -464,7 +464,7 @@ IcePatch2::removeRecursive(const string& pa) if(!isRoot(path)) { - if(IceInternal::OS::rmdir(path) == -1) + if(OS::rmdir(path) == -1) { throw "cannot remove directory `" + path + "':\n" + IceUtilInternal::lastErrorToString(); } @@ -472,7 +472,7 @@ IcePatch2::removeRecursive(const string& pa) } else { - if(IceInternal::OS::remove(path) == -1) + if(OS::remove(path) == -1) { throw "cannot remove file `" + path + "':\n" + IceUtilInternal::lastErrorToString(); } @@ -608,7 +608,7 @@ IcePatch2::createDirectory(const string& pa) { const string path = simplify(pa); - if(IceInternal::OS::mkdir(path, 0777) == -1) + if(OS::mkdir(path, 0777) == -1) { if(errno != EEXIST) { @@ -639,7 +639,7 @@ IcePatch2::createDirectoryRecursive(const string& pa) } } - if(IceInternal::OS::mkdir(path, 0777) == -1) + if(OS::mkdir(path, 0777) == -1) { if(errno != EEXIST) { @@ -654,7 +654,7 @@ IcePatch2::compressBytesToFile(const string& pa, const ByteSeq& bytes, Int pos) { const string path = simplify(pa); - FILE* stdioFile = IceInternal::OS::fopen(path, "wb"); + FILE* stdioFile = OS::fopen(path, "wb"); if(!stdioFile) { throw "cannot open `" + path + "' for writing:\n" + IceUtilInternal::lastErrorToString(); @@ -714,13 +714,13 @@ IcePatch2::decompressFile(const string& pa) try { - fp = IceInternal::OS::fopen(path, "wb"); + fp = OS::fopen(path, "wb"); if(!fp) { throw "cannot open `" + path + "' for writing:\n" + IceUtilInternal::lastErrorToString(); } - stdioFileBZ2 = IceInternal::OS::fopen(pathBZ2, "rb"); + stdioFileBZ2 = OS::fopen(pathBZ2, "rb"); if(!stdioFileBZ2) { throw "cannot open `" + pathBZ2 + "' for reading:\n" + IceUtilInternal::lastErrorToString(); @@ -1024,7 +1024,7 @@ getFileInfoSeqInt(const string& basePath, const string& relPath, int compress, G // if(doCompress) { - int fd = IceInternal::OS::open(path.c_str(), O_BINARY|O_RDONLY); + int fd = OS::open(path.c_str(), O_BINARY|O_RDONLY); if(fd == -1) { throw "cannot open `" + path + "' for reading:\n" + IceUtilInternal::lastErrorToString(); @@ -1056,7 +1056,7 @@ getFileInfoSeqInt(const string& basePath, const string& relPath, int compress, G close(fd); const string pathBZ2Temp = path + ".bz2temp"; - FILE* stdioFile = IceInternal::OS::fopen(pathBZ2Temp, "wb"); + FILE* stdioFile = OS::fopen(pathBZ2Temp, "wb"); if(fwrite(&compressedBytes[0], compressedLen, 1, stdioFile) != 1) { fclose(stdioFile); @@ -1070,7 +1070,7 @@ getFileInfoSeqInt(const string& basePath, const string& relPath, int compress, G } #endif - int fd = IceInternal::OS::open(path.c_str(), O_BINARY|O_RDONLY); + int fd = OS::open(path.c_str(), O_BINARY|O_RDONLY); if(fd == -1) { throw "cannot open `" + path + "' for reading:\n" + IceUtilInternal::lastErrorToString(); @@ -1083,7 +1083,7 @@ getFileInfoSeqInt(const string& basePath, const string& relPath, int compress, G BZFILE* bzFile = 0; if(doCompress) { - stdioFile = IceInternal::OS::fopen(simplify(pathBZ2Temp), "wb"); + stdioFile = OS::fopen(simplify(pathBZ2Temp), "wb"); if(!stdioFile) { #if defined(_MSC_VER) && (_MSC_VER >= 1400) @@ -1245,7 +1245,7 @@ IcePatch2::saveFileInfoSeq(const string& pa, const FileInfoSeq& infoSeq) { const string path = simplify(pa + '/' + checksumFile); - FILE* fp = IceInternal::OS::fopen(path, "w"); + FILE* fp = OS::fopen(path, "w"); if(!fp) { throw "cannot open `" + path + "' for writing:\n" + IceUtilInternal::lastErrorToString(); @@ -1287,7 +1287,7 @@ IcePatch2::loadFileInfoSeq(const string& pa, FileInfoSeq& infoSeq) { const string path = simplify(pa + '/' + checksumFile); - FILE* fp = IceInternal::OS::fopen(path, "r"); + FILE* fp = OS::fopen(path, "r"); if(!fp) { throw "cannot open `" + path + "' for reading:\n" + IceUtilInternal::lastErrorToString(); @@ -1314,7 +1314,7 @@ IcePatch2::loadFileInfoSeq(const string& pa, FileInfoSeq& infoSeq) { const string pathLog = simplify(pa + '/' + logFile); - FILE* fp = IceInternal::OS::fopen(pathLog, "r"); + FILE* fp = OS::fopen(pathLog, "r"); if(fp != 0) { FileInfoSeq remove; |