- Timestamp:
- Oct 27, 2010 9:23:42 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ExtPackManagerImpl.cpp
r33477 r33487 23 23 24 24 #include <iprt/dir.h> 25 #include <iprt/file.h> 25 26 #include <iprt/ldr.h> 26 27 #include <iprt/param.h> … … 378 379 STDMETHODIMP ExtPackManager::Install(IN_BSTR a_bstrTarball, BSTR *a_pbstrName) 379 380 { 380 NOREF(a_bstrTarball); NOREF(a_pbstrName); 381 return E_NOTIMPL; 381 CheckComArgNotNull(a_bstrTarball); 382 CheckComArgOutPointerValid(a_pbstrName); 383 Utf8Str strTarball(a_bstrTarball); 384 385 /* 386 * Check that the file exists and that we can access it. 387 */ 388 HRESULT hrc; 389 if (RTFileExists(strTarball.c_str())) 390 { 391 RTFILE hFile; 392 int vrc = RTFileOpen(&hFile, strTarball.c_str(), RTFILE_O_READ | RTFILE_O_DENY_WRITE | RTFILE_O_OPEN); 393 if (RT_SUCCESS(vrc)) 394 { 395 /* 396 * . 397 */ 398 399 400 RTFileClose(hFile); 401 } 402 else 403 hrc = setError(E_FAIL, tr("Failed to open '%s' (%Rrc)"), strTarball.c_str(), vrc); 404 } 405 else if (RTPathExists(strTarball.c_str())) 406 hrc = setError(E_FAIL, tr("'%s' is not a regular file"), strTarball.c_str()); 407 else 408 hrc = setError(E_FAIL, tr("File '%s' was inaccessible or not found"), strTarball.c_str()); 409 return hrc; 382 410 } 383 411
Note:
See TracChangeset
for help on using the changeset viewer.