Changeset 71319 in vbox
- Timestamp:
- Mar 14, 2018 12:25:05 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 121268
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp
r71251 r71319 1861 1861 if (RTFileExists(strSrc.c_str())) 1862 1862 { 1863 if (pCtx->cVerbose) 1864 RTPrintf("File '%s' -> '%s'\n", strSrc.c_str(), pszDst); 1865 1863 1866 SafeArray<FileCopyFlag_T> copyFlags; 1864 1867 rc = pCtx->pGuestSession->FileCopyToGuest(Bstr(strSrc).raw(), Bstr(pszDst).raw(), … … 1867 1870 else if (RTDirExists(strSrc.c_str())) 1868 1871 { 1872 if (pCtx->cVerbose) 1873 RTPrintf("Directory '%s' -> '%s'\n", strSrc.c_str(), pszDst); 1874 1869 1875 SafeArray<DirectoryCopyFlag_T> copyFlags; 1870 1876 copyFlags.push_back(DirectoryCopyFlag_CopyIntoExisting); … … 1877 1883 else 1878 1884 { 1879 if ( strSrc.endsWith("/") 1880 || strSrc.endsWith("\\")) 1881 { 1885 /* We need to query the source type on the guest first in order to know which copy flavor we need. */ 1886 ComPtr<IGuestFsObjInfo> pFsObjInfo; 1887 FsObjType_T enmObjType = FsObjType_Unknown; /* Shut up MSC */ 1888 rc = pCtx->pGuestSession->FsObjQueryInfo(Bstr(strSrc).raw(), TRUE /* fFollowSymlinks */, pFsObjInfo.asOutParam()); 1889 if (SUCCEEDED(rc)) 1890 rc = pFsObjInfo->COMGETTER(Type)(&enmObjType); 1891 if (FAILED(rc)) 1892 { 1893 if (pCtx->cVerbose) 1894 RTPrintf("Warning: Cannot stat for element '%s': No such element\n", strSrc.c_str()); 1895 continue; /* Skip. */ 1896 } 1897 1898 if (enmObjType == FsObjType_Directory) 1899 { 1900 if (pCtx->cVerbose) 1901 RTPrintf("Directory '%s' -> '%s'\n", strSrc.c_str(), pszDst); 1902 1882 1903 SafeArray<DirectoryCopyFlag_T> copyFlags; 1883 1904 copyFlags.push_back(DirectoryCopyFlag_CopyIntoExisting); … … 1885 1906 ComSafeArrayAsInParam(copyFlags), pProgress.asOutParam()); 1886 1907 } 1887 else 1888 { 1908 else if (enmObjType == FsObjType_File) 1909 { 1910 if (pCtx->cVerbose) 1911 RTPrintf("File '%s' -> '%s'\n", strSrc.c_str(), pszDst); 1912 1889 1913 SafeArray<FileCopyFlag_T> copyFlags; 1890 1914 rc = pCtx->pGuestSession->FileCopyFromGuest(Bstr(strSrc).raw(), Bstr(pszDst).raw(), 1891 1915 ComSafeArrayAsInParam(copyFlags), pProgress.asOutParam()); 1892 1916 } 1917 else if (pCtx->cVerbose) 1918 RTPrintf("Warning: Skipping '%s': Not handled\n", strSrc.c_str()); 1893 1919 } 1894 1920 }
Note:
See TracChangeset
for help on using the changeset viewer.