Changeset 83309 in vbox for trunk/src/VBox/Main
- Timestamp:
- Mar 17, 2020 1:54:12 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 136482
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/idl/VirtualBox.xidl
r83275 r83309 13449 13449 </param> 13450 13450 <param name="exists" type="boolean" dir="return"> 13451 <desc>Returns @c true if the directory exists, @c false if not .</desc>13451 <desc>Returns @c true if the directory exists, @c false if not, or is not a directory.</desc> 13452 13452 </param> 13453 13453 </method> -
trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp
r83295 r83309 962 962 } 963 963 964 /** 965 * Queries information about a directory on the guest. 966 * 967 * @returns VBox status code, or VERR_NOT_A_DIRECTORY if the file system object exists but is not a directory. 968 * @param strPath Path to directory to query information for. 969 * @param fFollowSymlinks Whether to follow symlinks or not. 970 * @param objData Where to store the information returned on success. 971 * @param prcGuest Guest rc, when returning VERR_GSTCTL_GUEST_ERROR. 972 */ 964 973 int GuestSession::i_directoryQueryInfo(const Utf8Str &strPath, bool fFollowSymlinks, 965 974 GuestFsObjData &objData, int *prcGuest) … … 3349 3358 HRESULT GuestSession::directoryExists(const com::Utf8Str &aPath, BOOL aFollowSymlinks, BOOL *aExists) 3350 3359 { 3351 AutoCaller autoCaller(this); /** @todo r=bird: GuestSessionWrap.cpp does already, doesn't it? */3352 if (FAILED(autoCaller.rc())) return autoCaller.rc();3353 3354 3360 if (RT_UNLIKELY(aPath.isEmpty())) 3355 3361 return setError(E_INVALIDARG, tr("Empty path")); … … 3363 3369 GuestFsObjData objData; 3364 3370 int rcGuest = VERR_IPE_UNINITIALIZED_STATUS; 3365 /** @todo r=bird: Please look at i_directoryQueryInfo() and explain why there 3366 * is an extra FsObjType_Directory check here... 3367 * 3368 * Looks a lot like you wanted to replicate the RTDirExists behavior, but when 3369 * refactoring in i_directoryQueryInfo you lost overview here. One problem 3370 * could be that the documention is VirtualBox.xidl does not mention what 3371 * happens when the path leads to a file system object that isn't a 3372 * directory. 3373 * 3374 * Fix the documention and behaviour so it works like RTDirExists and 3375 * RTFileExists. */ 3371 3376 3372 int vrc = i_directoryQueryInfo(aPath, aFollowSymlinks != FALSE, objData, &rcGuest); 3377 3373 if (RT_SUCCESS(vrc)) 3378 *aExists = objData.mType == FsObjType_Directory;3374 *aExists = TRUE; 3379 3375 else 3380 3376 { … … 3393 3389 break; 3394 3390 } 3391 break; 3392 } 3393 3394 case VERR_NOT_A_DIRECTORY: 3395 { 3396 *aExists = FALSE; 3395 3397 break; 3396 3398 }
Note:
See TracChangeset
for help on using the changeset viewer.