VirtualBox

Ignore:
Timestamp:
Nov 9, 2022 8:20:10 AM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
154484
Message:

Guest Control/Main: More fixes for single file copying into existing directories. bugref:10286

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/GuestSessionImplTasks.cpp

    r97448 r97474  
    16701670        if (pList->mSourceSpec.enmType == FsObjType_Directory)
    16711671        {
    1672             LogFlowFunc(("Directory: fDirCopyFlags=%#x, fCopyIntoExisting=%RTbool, fFollowSymlinks=%RTbool\n",
    1673                          pList->mSourceSpec.fDirCopyFlags, fCopyIntoExisting, fFollowSymlinks));
     1672            LogFlowFunc(("Directory: fDirCopyFlags=%#x, fCopyIntoExisting=%RTbool, fFollowSymlinks=%RTbool -> fDstExist=%RTbool (%s)\n",
     1673                         pList->mSourceSpec.fDirCopyFlags, fCopyIntoExisting, fFollowSymlinks,
     1674                         fDstExists, GuestBase::fsObjTypeToStr(GuestBase::fileModeToFsObjType(ObjInfo.Attr.fMode))));
    16741675
    16751676            if (fDstExists)
     
    17981799        else if (pList->mSourceSpec.enmType == FsObjType_File)
    17991800        {
    1800             LogFlowFunc(("File: fFileCopyFlags=%#x, fCopyIntoExisting=%RTbool, fFollowSymlinks=%RTbool\n",
    1801                          pList->mSourceSpec.fFileCopyFlags, fCopyIntoExisting, fFollowSymlinks));
     1801            LogFlowFunc(("File: fFileCopyFlags=%#x, fCopyIntoExisting=%RTbool, fFollowSymlinks=%RTbool -> fDstExist=%RTbool (%s)\n",
     1802                         pList->mSourceSpec.fFileCopyFlags, fCopyIntoExisting, fFollowSymlinks,
     1803                         fDstExists, GuestBase::fsObjTypeToStr(GuestBase::fileModeToFsObjType(ObjInfo.Attr.fMode))));
    18021804
    18031805            if (fDstExists)
     
    18071809                    case RTFS_TYPE_DIRECTORY:
    18081810                    {
    1809                         if (!fCopyIntoExisting)
    1810                         {
    1811                             setProgressErrorMsg(VBOX_E_IPRT_ERROR,
    1812                                                 Utf8StrFmt(tr("Destination \"%s\" on the host already exists and is a directory"),
    1813                                                            strDstRootAbs.c_str()));
    1814                             vrc = VERR_IS_A_DIRECTORY;
    1815                             break;
    1816                         }
    1817 
    1818                         /* Append the actual file name to the destination. */
    1819                         strDstRootAbs += PATH_STYLE_SEP_STR(PATH_STYLE_NATIVE);
    1820                         strDstRootAbs += RTPathFilename(strSrcRootAbs.c_str());
     1811                        setProgressErrorMsg(VBOX_E_IPRT_ERROR,
     1812                                            Utf8StrFmt(tr("Destination \"%s\" on the host already exists and is a directory"),
     1813                                                       strDstRootAbs.c_str()));
     1814                        vrc = VERR_IS_A_DIRECTORY;
    18211815                        break;
    18221816                    }
     
    21422136        if (pList->mSourceSpec.enmType == FsObjType_Directory)
    21432137        {
    2144             LogFlowFunc(("Directory: fDirCopyFlags=%#x, fCopyIntoExisting=%RTbool, fFollowSymlinks=%RTbool\n",
    2145                          pList->mSourceSpec.fDirCopyFlags, fCopyIntoExisting, fFollowSymlinks));
     2138            LogFlowFunc(("Directory: fDirCopyFlags=%#x, fCopyIntoExisting=%RTbool, fFollowSymlinks=%RTbool -> fDstExist=%RTbool (%s)\n",
     2139                         pList->mSourceSpec.fDirCopyFlags, fCopyIntoExisting, fFollowSymlinks,
     2140                         fDstExists, GuestBase::fsObjTypeToStr(dstObjData.mType)));
    21462141
    21472142            if (fDstExists)
     
    22772272        else if (pList->mSourceSpec.enmType == FsObjType_File)
    22782273        {
    2279             LogFlowFunc(("File: fFileCopyFlags=%#x, fCopyIntoExisting=%RTbool, fFollowSymlinks=%RTbool\n",
    2280                          pList->mSourceSpec.fFileCopyFlags, fCopyIntoExisting, fFollowSymlinks));
     2274            LogFlowFunc(("File: fFileCopyFlags=%#x, fCopyIntoExisting=%RTbool, fFollowSymlinks=%RTbool -> fDstExist=%RTbool (%s)\n",
     2275                         pList->mSourceSpec.fFileCopyFlags, fCopyIntoExisting, fFollowSymlinks,
     2276                         fDstExists, GuestBase::fsObjTypeToStr(dstObjData.mType)));
    22812277
    22822278            if (fDstExists)
     
    22862282                    case FsObjType_Directory:
    22872283                    {
    2288                         if (!fCopyIntoExisting)
    2289                         {
    2290                             setProgressErrorMsg(VBOX_E_IPRT_ERROR,
    2291                                                 Utf8StrFmt(tr("Destination \"%s\" on the guest already exists and is a directory"),
    2292                                                            strDstRootAbs.c_str()));
    2293                             vrc = VERR_IS_A_DIRECTORY;
    2294                             break;
    2295                         }
    2296 
    2297                         /* Append the actual file name to the destination. */
    2298                         strDstRootAbs += PATH_STYLE_SEP_STR(mSession->i_getGuestPathStyle());
    2299                         strDstRootAbs += RTPathFilename(strSrcRootAbs.c_str());
     2284                        setProgressErrorMsg(VBOX_E_IPRT_ERROR,
     2285                                            Utf8StrFmt(tr("Destination \"%s\" on the guest already exists and is a directory"),
     2286                                                       strDstRootAbs.c_str()));
     2287                        vrc = VERR_IS_A_DIRECTORY;
    23002288                        break;
    23012289                    }
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette