diff options
author | Clinton Stimpson <clinton@elemtech.com> | 2015-08-15 05:14:06 (GMT) |
---|---|---|
committer | Clinton Stimpson <clinton@elemtech.com> | 2015-08-15 05:14:06 (GMT) |
commit | e06ea8373f434fa581cc7c88366fa483b741aebd (patch) | |
tree | 8b676fe7bc80e57be9c0d34c7746769a9d62b5f5 /Source/cmSystemTools.cxx | |
parent | 17ecfd8210b4db74753c4565b10a2b75dfa4c480 (diff) | |
download | CMake-e06ea8373f434fa581cc7c88366fa483b741aebd.zip CMake-e06ea8373f434fa581cc7c88366fa483b741aebd.tar.gz CMake-e06ea8373f434fa581cc7c88366fa483b741aebd.tar.bz2 |
cmSystemTools: Use extended length paths for Windows apis.
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r-- | Source/cmSystemTools.cxx | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 2543e68..a117238 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -950,8 +950,9 @@ bool cmSystemTools::RenameFile(const char* oldname, const char* newname) Try multiple times since we may be racing against another process creating/opening the destination file just before our MoveFileEx. */ WindowsFileRetry retry = cmSystemTools::GetWindowsFileRetry(); - while(!MoveFileExW(cmsys::Encoding::ToWide(oldname).c_str(), - cmsys::Encoding::ToWide(newname).c_str(), + while(!MoveFileExW( + SystemTools::ConvertToWindowsExtendedPath(oldname).c_str(), + SystemTools::ConvertToWindowsExtendedPath(newname).c_str(), MOVEFILE_REPLACE_EXISTING) && --retry.Count) { DWORD last_error = GetLastError(); @@ -962,12 +963,14 @@ bool cmSystemTools::RenameFile(const char* oldname, const char* newname) return false; } DWORD attrs = - GetFileAttributesW(cmsys::Encoding::ToWide(newname).c_str()); + GetFileAttributesW( + SystemTools::ConvertToWindowsExtendedPath(newname).c_str()); if((attrs != INVALID_FILE_ATTRIBUTES) && (attrs & FILE_ATTRIBUTE_READONLY)) { // Remove the read-only attribute from the destination file. - SetFileAttributesW(cmsys::Encoding::ToWide(newname).c_str(), + SetFileAttributesW( + SystemTools::ConvertToWindowsExtendedPath(newname).c_str(), attrs & ~FILE_ATTRIBUTE_READONLY); } else @@ -1956,11 +1959,11 @@ bool cmSystemTools::CopyFileTime(const char* fromFile, const char* toFile) { #if defined(_WIN32) && !defined(__CYGWIN__) cmSystemToolsWindowsHandle hFrom = - CreateFileW(cmsys::Encoding::ToWide(fromFile).c_str(), + CreateFileW(SystemTools::ConvertToWindowsExtendedPath(fromFile).c_str(), GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0); cmSystemToolsWindowsHandle hTo = - CreateFileW(cmsys::Encoding::ToWide(toFile).c_str(), + CreateFileW(SystemTools::ConvertToWindowsExtendedPath(toFile).c_str(), GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0); if(!hFrom || !hTo) { @@ -2012,7 +2015,7 @@ bool cmSystemTools::FileTimeGet(const char* fname, cmSystemToolsFileTime* t) { #if defined(_WIN32) && !defined(__CYGWIN__) cmSystemToolsWindowsHandle h = - CreateFileW(cmsys::Encoding::ToWide(fname).c_str(), + CreateFileW(SystemTools::ConvertToWindowsExtendedPath(fname).c_str(), GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0); if(!h) { @@ -2039,7 +2042,7 @@ bool cmSystemTools::FileTimeSet(const char* fname, cmSystemToolsFileTime* t) { #if defined(_WIN32) && !defined(__CYGWIN__) cmSystemToolsWindowsHandle h = - CreateFileW(cmsys::Encoding::ToWide(fname).c_str(), + CreateFileW(SystemTools::ConvertToWindowsExtendedPath(fname).c_str(), GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0); if(!h) { |