- Timestamp:
- Mar 7, 2018 1:11:42 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/GuestSessionImplTasks.cpp
r71252 r71256 1018 1018 } 1019 1019 1020 RT_NOREF(fRecursive, fFollowSymlinks);1021 1022 1020 ComObjPtr<GuestFsObjInfo> fsObjInfo; 1023 1021 while (RT_SUCCESS(rc = pDir->i_readInternal(fsObjInfo, &rcGuest))) 1024 1022 { 1025 com::Bstr aName; 1026 fsObjInfo->COMGETTER(Name)(aName.asOutParam()); 1027 LogFlowThisFunc(("strName=%ls\n", aName.raw())); 1023 FsObjType_T enmObjType = FsObjType_Unknown; /* Shut up MSC. */ 1024 HRESULT hr2 = fsObjInfo->COMGETTER(Type)(&enmObjType); 1025 AssertComRC(hr2); 1026 1027 com::Bstr bstrName; 1028 hr2 = fsObjInfo->COMGETTER(Name)(bstrName.asOutParam()); 1029 AssertComRC(hr2); 1030 1031 Utf8Str strName(bstrName); 1032 1033 LogFlowThisFunc(("strName=%ls\n", strName.c_str())); 1034 1035 switch (enmObjType) 1036 { 1037 case FsObjType_Directory: 1038 { 1039 bool fSkip = false; 1040 1041 if ( strName.equals(".") 1042 || strName.equals("..")) 1043 { 1044 fSkip = true; 1045 } 1046 1047 if ( strFilter.isNotEmpty() 1048 && !RTStrSimplePatternMatch(strFilter.c_str(), strName.c_str())) 1049 fSkip = true; 1050 1051 if ( fRecursive 1052 && !fSkip) 1053 rc = directoryCopyToHost(strSrcDir, strFilter, strDstDir, fRecursive, fFollowSymlinks, 1054 strSrcSubDir + strName); 1055 break; 1056 } 1057 1058 case FsObjType_Symlink: 1059 { 1060 if (fFollowSymlinks) 1061 { /* Fall through to next case is intentional. */ } 1062 else 1063 break; 1064 RT_FALL_THRU(); 1065 } 1066 1067 case FsObjType_File: 1068 { 1069 if ( strFilter.isNotEmpty() 1070 && !RTStrSimplePatternMatch(strFilter.c_str(), strName.c_str())) 1071 { 1072 break; /* Filter does not match. */ 1073 } 1074 1075 if (RT_SUCCESS(rc)) 1076 { 1077 Utf8Str strSrcFile = strSrcDir + strSrcSubDir + strName; 1078 Utf8Str strDstFile = strDstDir + strSrcSubDir + strName; 1079 rc = fileCopyFrom(strSrcFile, strDstFile, FileCopyFlag_None); 1080 } 1081 break; 1082 } 1083 1084 default: 1085 break; 1086 } 1028 1087 } 1029 1088
Note:
See TracChangeset
for help on using the changeset viewer.