Changeset 69758 in vbox for trunk/src/VBox/Frontends/VBoxManage
- Timestamp:
- Nov 19, 2017 3:23:57 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp
r69753 r69758 2232 2232 * Enumerate the directory tree. 2233 2233 */ 2234 size_t cbDirEntry = 0; 2235 PRTDIRENTRYEX pDirEntry = NULL; 2234 2236 while (RT_SUCCESS(vrc)) 2235 2237 { 2236 RTDIRENTRY DirEntry; 2237 vrc = RTDirRead(hDir, &DirEntry, NULL); 2238 vrc = RTDirReadExA(hDir, &pDirEntry, &cbDirEntry, RTFSOBJATTRADD_NOTHING, 0); 2238 2239 if (RT_FAILURE(vrc)) 2239 2240 { … … 2242 2243 break; 2243 2244 } 2244 /** @todo r=bird: This ain't gonna work on most UNIX file systems because 2245 * enmType is RTDIRENTRYTYPE_UNKNOWN. This is clearly documented in 2246 * RTDIRENTRY::enmType. For trunk, RTDirQueryUnknownType can be used. */ 2247 switch (DirEntry.enmType) 2245 2246 switch (pDirEntry->Info.Attr.fMode & RTFS_TYPE_MASK) 2248 2247 { 2249 case RT DIRENTRYTYPE_DIRECTORY:2248 case RTFS_TYPE_DIRECTORY: 2250 2249 { 2251 2250 /* Skip "." and ".." entries. */ 2252 if ( !strcmp(DirEntry.szName, ".") 2253 || !strcmp(DirEntry.szName, "..")) 2251 if (RTDirEntryExIsStdDotLink(pDirEntry)) 2254 2252 break; 2255 2253 2256 2254 if (pContext->pCmdCtx->cVerbose) 2257 RTPrintf("Directory: %s\n", DirEntry.szName);2255 RTPrintf("Directory: %s\n", pDirEntry->szName); 2258 2256 2259 2257 if (enmFlags & kGctlCopyFlags_Recursive) … … 2261 2259 char *pszNewSub = NULL; 2262 2260 if (pszSubDir) 2263 pszNewSub = RTPathJoinA(pszSubDir, DirEntry.szName);2261 pszNewSub = RTPathJoinA(pszSubDir, pDirEntry->szName); 2264 2262 else 2265 2263 { 2266 pszNewSub = RTStrDup( DirEntry.szName);2264 pszNewSub = RTStrDup(pDirEntry->szName); 2267 2265 RTPathStripTrailingSlash(pszNewSub); 2268 2266 } … … 2281 2279 } 2282 2280 2283 case RT DIRENTRYTYPE_SYMLINK:2281 case RTFS_TYPE_SYMLINK: 2284 2282 if ( (enmFlags & kGctlCopyFlags_Recursive) 2285 2283 && (enmFlags & kGctlCopyFlags_FollowLinks)) 2286 { 2287 /* Fall through to next case is intentional. */ 2288 } 2284 { /* Fall through to next case is intentional. */ } 2289 2285 else 2290 2286 break; 2291 2292 case RTDIRENTRYTYPE_FILE: 2287 RT_FALL_THRU(); 2288 2289 case RTFS_TYPE_FILE: 2293 2290 { 2294 2291 if ( pszFilter 2295 && !RTStrSimplePatternMatch(pszFilter, DirEntry.szName))2292 && !RTStrSimplePatternMatch(pszFilter, pDirEntry->szName)) 2296 2293 { 2297 2294 break; /* Filter does not match. */ … … 2299 2296 2300 2297 if (pContext->pCmdCtx->cVerbose) 2301 RTPrintf("File: %s\n", DirEntry.szName);2298 RTPrintf("File: %s\n", pDirEntry->szName); 2302 2299 2303 2300 if (!fDirCreated) 2304 2301 { 2305 2302 char *pszDestDir; 2306 vrc = gctlCopyTranslatePath(pszSource, szCurDir, 2307 pszDest, &pszDestDir); 2303 vrc = gctlCopyTranslatePath(pszSource, szCurDir, pszDest, &pszDestDir); 2308 2304 if (RT_SUCCESS(vrc)) 2309 2305 { … … 2317 2313 if (RT_SUCCESS(vrc)) 2318 2314 { 2319 char *pszFileSource = RTPathJoinA(szCurDir, DirEntry.szName);2315 char *pszFileSource = RTPathJoinA(szCurDir, pDirEntry->szName); 2320 2316 if (pszFileSource) 2321 2317 { 2322 2318 char *pszFileDest; 2323 vrc = gctlCopyTranslatePath(pszSource, pszFileSource, 2324 pszDest, &pszFileDest); 2319 vrc = gctlCopyTranslatePath(pszSource, pszFileSource, pszDest, &pszFileDest); 2325 2320 if (RT_SUCCESS(vrc)) 2326 2321 { … … 2342 2337 } 2343 2338 2339 RTDirReadExAFree(&pDirEntry, &cbDirEntry); 2344 2340 RTDirClose(hDir); 2345 2341 }
Note:
See TracChangeset
for help on using the changeset viewer.