Index: src/libchcore/TSubTaskCopyMove.cpp =================================================================== diff -u -N -r861eb97e5f43584f9537b4aff0558f6689bd0e38 -r0380c176d1cfcdfd1cd2adfe01d9c1c5c38df9f1 --- src/libchcore/TSubTaskCopyMove.cpp (.../TSubTaskCopyMove.cpp) (revision 861eb97e5f43584f9537b4aff0558f6689bd0e38) +++ src/libchcore/TSubTaskCopyMove.cpp (.../TSubTaskCopyMove.cpp) (revision 0380c176d1cfcdfd1cd2adfe01d9c1c5c38df9f1) @@ -243,9 +243,35 @@ } } - m_tSubTaskStats.SetCurrentIndex(fcIndex); + // update directories file times + bool bUpdateDirTimes = GetTaskPropValue(rConfig); + if(bUpdateDirTimes) + { + rLog.logi(_T("Setting directory attributes")); - // new stats + // iterate backwards + for(file_count_t fcAttrIndex = fcSize; fcAttrIndex != 0; --fcAttrIndex) + { + // should we kill ? + if(rThreadController.KillRequested()) + { + // log + rLog.logi(_T("Kill request while processing file in ProcessFiles")); + return TSubTaskBase::eSubResult_KillRequest; + } + + TFileInfoPtr spFileInfo = rFilesCache.GetAt(fcAttrIndex - 1); + if(spFileInfo->IsDirectory()) + { + TSmartPath pathDstDir = CalculateDestinationPath(spFileInfo, pathDestination, ((int)bForceDirectories) << 1 | (int)bIgnoreFolders); + + spFilesystem->SetFileDirectoryTime(pathDstDir, spFileInfo->GetCreationTime(), spFileInfo->GetLastAccessTime(), spFileInfo->GetLastWriteTime()); + } + } + } + + // stats + m_tSubTaskStats.SetCurrentIndex(fcIndex); m_tSubTaskStats.SetProcessedCount(fcIndex); m_tSubTaskStats.SetCurrentPath(TString());