Index: src/ch/TBasePathData.cpp =================================================================== diff -u -r4c09a2d7ab35a30114ff2b7c4db12bc413bf538c -r9a171c5d46f2bc029d99a698d88eeff60497cd3b --- src/ch/TBasePathData.cpp (.../TBasePathData.cpp) (revision 4c09a2d7ab35a30114ff2b7c4db12bc413bf538c) +++ src/ch/TBasePathData.cpp (.../TBasePathData.cpp) (revision 9a171c5d46f2bc029d99a698d88eeff60497cd3b) @@ -29,14 +29,12 @@ // TBasePathData TBasePathData::TBasePathData() : - m_bMove(true), - m_iDriveNumber(-2) + m_bMove(true) { } TBasePathData::TBasePathData(const TBasePathData& rEntry) : m_bMove(rEntry.m_bMove), - m_iDriveNumber(rEntry.m_iDriveNumber), m_pathDst(rEntry.m_pathDst) { } Index: src/ch/TBasePathData.h =================================================================== diff -u -r4c09a2d7ab35a30114ff2b7c4db12bc413bf538c -r9a171c5d46f2bc029d99a698d88eeff60497cd3b --- src/ch/TBasePathData.h (.../TBasePathData.h) (revision 4c09a2d7ab35a30114ff2b7c4db12bc413bf538c) +++ src/ch/TBasePathData.h (.../TBasePathData.h) (revision 9a171c5d46f2bc029d99a698d88eeff60497cd3b) @@ -36,10 +36,6 @@ void SetMove(bool bValue) { m_bMove=bValue; } bool GetMove() const { return m_bMove; } - int GetDriveNumber() { return m_iDriveNumber; } - void SetDriveNumber(int iDriveNumber) { m_iDriveNumber = iDriveNumber; } - bool IsDriveNumberSet() const { return m_iDriveNumber != -2; } - void SetDestinationPath(const chcore::TSmartPath& strPath); chcore::TSmartPath GetDestinationPath() const; bool IsDestinationPathSet() const { return !m_pathDst.IsEmpty(); } @@ -50,8 +46,6 @@ private: bool m_bMove; // specifies if we can use MoveFile (if will be moved) - int m_iDriveNumber; // disk number (default -1 - none) - chcore::TSmartPath m_pathDst; // dest path }; Index: src/ch/TSubTaskBase.cpp =================================================================== diff -u -r6dc950d4d76107421ff6eb62069b70f20bcc450e -r9a171c5d46f2bc029d99a698d88eeff60497cd3b --- src/ch/TSubTaskBase.cpp (.../TSubTaskBase.cpp) (revision 6dc950d4d76107421ff6eb62069b70f20bcc450e) +++ src/ch/TSubTaskBase.cpp (.../TSubTaskBase.cpp) (revision 9a171c5d46f2bc029d99a698d88eeff60497cd3b) @@ -40,32 +40,6 @@ { } - -int TSubTaskBase::GetDriveNumber(const CFileInfoPtr& spFileInfo) -{ - if(!spFileInfo) - THROW(_T("Invalid pointer"), 0, 0, 0); - if(spFileInfo->GetSrcIndex() == std::numeric_limits::max()) - THROW(_T("Received non-relative (standalone) path info"), 0, 0, 0); - - // check if this information has already been stored - size_t stBaseIndex = spFileInfo->GetSrcIndex(); - if(stBaseIndex >= GetContext().GetBasePathDataContainer().GetCount()) - THROW(_T("Index out of bounds"), 0, 0, 0); - - TBasePathDataPtr spPathData = GetContext().GetBasePathDataContainer().GetAt(stBaseIndex); - if(spPathData->IsDriveNumberSet()) - return spPathData->GetDriveNumber(); - - // drive number wasn't cached previously - read it now - int iDriveNumber = 0; - TLocalFilesystem::GetDriveData(GetContext().GetTaskDefinition().GetSourcePathAt(stBaseIndex), &iDriveNumber, NULL); - - spPathData->SetDriveNumber(iDriveNumber); - - return iDriveNumber; -} - chcore::TSmartPath TSubTaskBase::CalculateDestinationPath(const CFileInfoPtr& spFileInfo, chcore::TSmartPath pathDst, int iFlags) const { const TBasePathDataContainer& rSourcePathsInfo = GetContext().GetBasePathDataContainer(); Index: src/ch/TSubTaskBase.h =================================================================== diff -u -r6e8aa26e2428e3bc71099255c5911f57bc722100 -r9a171c5d46f2bc029d99a698d88eeff60497cd3b --- src/ch/TSubTaskBase.h (.../TSubTaskBase.h) (revision 6e8aa26e2428e3bc71099255c5911f57bc722100) +++ src/ch/TSubTaskBase.h (.../TSubTaskBase.h) (revision 9a171c5d46f2bc029d99a698d88eeff60497cd3b) @@ -54,7 +54,6 @@ protected: // some common operations - int GetDriveNumber(const CFileInfoPtr& spFileInfo); chcore::TSmartPath CalculateDestinationPath(const CFileInfoPtr& spFileInfo, chcore::TSmartPath strPath, int iFlags) const; chcore::TSmartPath FindFreeSubstituteName(chcore::TSmartPath pathSrcPath, chcore::TSmartPath pathDstPath) const; Index: src/ch/TSubTaskCopyMove.cpp =================================================================== diff -u -r4c09a2d7ab35a30114ff2b7c4db12bc413bf538c -r9a171c5d46f2bc029d99a698d88eeff60497cd3b --- src/ch/TSubTaskCopyMove.cpp (.../TSubTaskCopyMove.cpp) (revision 4c09a2d7ab35a30114ff2b7c4db12bc413bf538c) +++ src/ch/TSubTaskCopyMove.cpp (.../TSubTaskCopyMove.cpp) (revision 9a171c5d46f2bc029d99a698d88eeff60497cd3b) @@ -129,14 +129,13 @@ ccp.pathDstFile = CalculateDestinationPath(spFileInfo, rTaskDefinition.GetDestinationPath(), ((int)bForceDirectories) << 1 | (int)bIgnoreFolders); // are the files/folders lie on the same partition ? - int iDstDriveNumber = 0; + wchar_t wchDestinationDrive = rTaskDefinition.GetDestinationPath().GetDriveLetter(); bool bMove = rTaskDefinition.GetOperationType() == chcore::eOperation_Move; - if(bMove) - TLocalFilesystem::GetDriveData(rTaskDefinition.GetDestinationPath(), &iDstDriveNumber, NULL); - if(bMove && iDstDriveNumber != -1 && iDstDriveNumber == GetDriveNumber(spFileInfo) && GetMove(spFileInfo)) + chcore::TSmartPath pathCurrent = spFileInfo->GetFullFilePath(); + if(bMove && wchDestinationDrive != L'\0' && wchDestinationDrive == pathCurrent.GetDriveLetter() && GetMove(spFileInfo)) { bool bRetry = true; - if(bRetry && !TLocalFilesystem::FastMove(spFileInfo->GetFullFilePath(), ccp.pathDstFile)) + if(bRetry && !TLocalFilesystem::FastMove(pathCurrent, ccp.pathDstFile)) { dwLastError=GetLastError(); //log Index: src/ch/TSubTaskScanDirectory.cpp =================================================================== diff -u -r6dc950d4d76107421ff6eb62069b70f20bcc450e -r9a171c5d46f2bc029d99a698d88eeff60497cd3b --- src/ch/TSubTaskScanDirectory.cpp (.../TSubTaskScanDirectory.cpp) (revision 6dc950d4d76107421ff6eb62069b70f20bcc450e) +++ src/ch/TSubTaskScanDirectory.cpp (.../TSubTaskScanDirectory.cpp) (revision 9a171c5d46f2bc029d99a698d88eeff60497cd3b) @@ -61,8 +61,7 @@ GetTaskPropValue(rTaskDefinition.GetConfiguration(), afFilters); // enter some data to rFilesCache - int iDestDrvNumber = 0; - TLocalFilesystem::GetDriveData(rTaskDefinition.GetDestinationPath(), &iDestDrvNumber, NULL); + wchar_t wchDestinationDriveLetter = rTaskDefinition.GetDestinationPath().GetDriveLetter(); bool bIgnoreDirs = GetTaskPropValue(rTaskDefinition.GetConfiguration()); bool bForceDirectories = GetTaskPropValue(rTaskDefinition.GetConfiguration()); @@ -141,6 +140,8 @@ rarrSourcePathsInfo.GetAt(stIndex)->SetDestinationPath(spFileInfo->GetFullFilePath().GetFileName()); } + wchar_t wchSourceDriveLetter = spFileInfo->GetFullFilePath().GetDriveLetter(); + // add if needed if(spFileInfo->IsDirectory()) { @@ -157,7 +158,7 @@ } // don't add folder contents when moving inside one disk boundary - if(bIgnoreDirs || !bMove || iDestDrvNumber == -1 || iDestDrvNumber != GetDriveNumber(spFileInfo) || + if(bIgnoreDirs || !bMove || wchDestinationDriveLetter == L'\0' || wchDestinationDriveLetter != wchSourceDriveLetter || TLocalFilesystem::PathExist(CalculateDestinationPath(spFileInfo, rTaskDefinition.GetDestinationPath(), ((int)bForceDirectories) << 1)) ) { // log @@ -182,7 +183,7 @@ } else { - if(bMove && iDestDrvNumber != -1 && iDestDrvNumber == GetDriveNumber(spFileInfo) && + if(bMove && wchDestinationDriveLetter != L'\0' && wchDestinationDriveLetter == wchSourceDriveLetter && !TLocalFilesystem::PathExist(CalculateDestinationPath(spFileInfo, rTaskDefinition.GetDestinationPath(), ((int)bForceDirectories) << 1)) ) { // if moving within one partition boundary set the file size to 0 so the overall size will