diff -r ba8a586c45f1 -r c20154ccf3c0 filebrowser/engine/FBFileOps.cpp --- a/filebrowser/engine/FBFileOps.cpp Fri Jun 11 16:29:34 2010 +0100 +++ b/filebrowser/engine/FBFileOps.cpp Thu Jul 22 16:33:59 2010 +0100 @@ -254,6 +254,8 @@ } else { + // ensure that root target folder exists + BaflUtils::EnsurePathExistsL(iFs, iBuf2); // otherwise copy the file FileOpCopy(fullSourcePath, fullTargetPath, iUint1); } @@ -331,7 +333,11 @@ { path.Append(entry.iName); path.Append(_L("\\")); - DoFindEntries(aFileName, path); + // test path.Left(iBuf2.Length()).Compare(iBuf2) - to prevent never ending recursive copy (in case of copy folder under itself) + if( !(iRecursiveState == EFileOpCopy && !path.Left(iBuf2.Length()).Compare(iBuf2)) ) + { + DoFindEntries(aFileName, path); + } } } if ( iFileManObserverResult == MFileManObserver::ECancel ) @@ -380,17 +386,13 @@ iBuf2.Copy(targetPath); iUint1 = newSwitch; - // create initial directory - if it does not succeed, do not even try to continue - err = FileOpMkDirAll(targetPath, aSourceEntry.iEntry.iAtt); - - if (iOperationError == KErrNone) + TRAP(err, DoFindEntries(_L("*"), sourcePath)); // entries under current directory entry + if ( iFileManObserverResult != MFileManObserver::ECancel ) { - TRAP(err, DoFindEntries(_L("*"), sourcePath)); // entries under current directory entry - if ( iFileManObserverResult != MFileManObserver::ECancel ) - { - TRAP(err, DoFindEntriesRecursiveL(_L("*"), sourcePath)); // recursively under directories of current directory entry - } + TRAP(err, DoFindEntriesRecursiveL(_L("*"), sourcePath)); // recursively under directories of current directory entry } + // a path has a trailing backslash so it needs to be removed before the call + err = FileOpAttribs(targetPath.Left(targetPath.Length()-1), aSourceEntry.iEntry.iAtt, 0, 0, 0); } else if (aSourceEntry.iEntry.IsDir())