Changeset 69758 in vbox
- Timestamp:
- Nov 19, 2017 3:23:57 PM (7 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 2 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 } -
trunk/src/VBox/GuestHost/DragAndDrop/DnDURIList.cpp
r69755 r69758 128 128 { 129 129 rc = addEntry(pcszSrcPath, &pcszDstPath[cchDstBase], fFlags); 130 131 130 if (RT_SUCCESS(rc)) 132 131 { … … 135 134 if (RT_SUCCESS(rc)) 136 135 { 136 size_t cbDirEntry = 0; 137 PRTDIRENTRYEX pDirEntry = NULL; 137 138 do 138 139 { 139 RTDIRENTRY DirEntry;140 rc = RTDirRead (hDir, &DirEntry, NULL);140 /* Retrieve the next directory entry. */ 141 rc = RTDirReadExA(hDir, &pDirEntry, &cbDirEntry, RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK); 141 142 if (RT_FAILURE(rc)) 142 143 { … … 145 146 break; 146 147 } 147 /** @todo r=bird: you really need to read the documentation! I already 148 * pointed out that this isn't goint to work in the guest control 149 * code. sigh. */ 150 151 switch (DirEntry.enmType) 148 149 switch (pDirEntry->Info.Attr.fMode & RTFS_TYPE_MASK) 152 150 { 153 case RT DIRENTRYTYPE_DIRECTORY:151 case RTFS_TYPE_DIRECTORY: 154 152 { 155 153 /* Skip "." and ".." entries. */ 156 if (RTDirEntry IsStdDotLink(&DirEntry))154 if (RTDirEntryExIsStdDotLink(pDirEntry)) 157 155 break; 158 156 159 char *pszSrc = RTPathJoinA(pcszSrcPath, DirEntry.szName);157 char *pszSrc = RTPathJoinA(pcszSrcPath, pDirEntry->szName); 160 158 if (pszSrc) 161 159 { 162 char *pszDst = RTPathJoinA(pcszDstPath, DirEntry.szName);160 char *pszDst = RTPathJoinA(pcszDstPath, pDirEntry->szName); 163 161 if (pszDst) 164 162 { … … 176 174 } 177 175 178 case RT DIRENTRYTYPE_FILE:176 case RTFS_TYPE_FILE: 179 177 { 180 char *pszSrc = RTPathJoinA(pcszSrcPath, DirEntry.szName);178 char *pszSrc = RTPathJoinA(pcszSrcPath, pDirEntry->szName); 181 179 if (pszSrc) 182 180 { 183 char *pszDst = RTPathJoinA(pcszDstPath, DirEntry.szName);181 char *pszDst = RTPathJoinA(pcszDstPath, pDirEntry->szName); 184 182 if (pszDst) 185 183 { … … 195 193 break; 196 194 } 197 case RT DIRENTRYTYPE_SYMLINK:195 case RTFS_TYPE_SYMLINK: 198 196 { 199 197 if (fFlags & DNDURILIST_FLAGS_RESOLVE_SYMLINKS) … … 233 231 } while (RT_SUCCESS(rc)); 234 232 233 RTDirReadExAFree(&pDirEntry, &cbDirEntry); 235 234 RTDirClose(hDir); 236 235 }
Note:
See TracChangeset
for help on using the changeset viewer.