GuestDirectoryImpl.cpp revision c10a6f0c7041e4d1ee50ad38425aab9d43c55522
4a5d1cb72abd351221a0d5bdce3a01b071f697a9vboxsync * VirtualBox Main - XXX.
4a5d1cb72abd351221a0d5bdce3a01b071f697a9vboxsync * Copyright (C) 2012 Oracle Corporation
4a5d1cb72abd351221a0d5bdce3a01b071f697a9vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
4a5d1cb72abd351221a0d5bdce3a01b071f697a9vboxsync * available from http://www.virtualbox.org. This file is free software;
4a5d1cb72abd351221a0d5bdce3a01b071f697a9vboxsync * you can redistribute it and/or modify it under the terms of the GNU
4a5d1cb72abd351221a0d5bdce3a01b071f697a9vboxsync * General Public License (GPL) as published by the Free Software
4a5d1cb72abd351221a0d5bdce3a01b071f697a9vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
4a5d1cb72abd351221a0d5bdce3a01b071f697a9vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
4a5d1cb72abd351221a0d5bdce3a01b071f697a9vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
4a5d1cb72abd351221a0d5bdce3a01b071f697a9vboxsync/*******************************************************************************
4a5d1cb72abd351221a0d5bdce3a01b071f697a9vboxsync* Header Files *
4a5d1cb72abd351221a0d5bdce3a01b071f697a9vboxsync*******************************************************************************/
4a5d1cb72abd351221a0d5bdce3a01b071f697a9vboxsync// constructor / destructor
4a5d1cb72abd351221a0d5bdce3a01b071f697a9vboxsync/////////////////////////////////////////////////////////////////////////////
4a5d1cb72abd351221a0d5bdce3a01b071f697a9vboxsync// public initializer/uninitializer for internal purposes only
558469ae1e17102c9ee2f2ece90aa7dc5137e0ccvboxsync/////////////////////////////////////////////////////////////////////////////
4a5d1cb72abd351221a0d5bdce3a01b071f697a9vboxsync const Utf8Str &strPath, const Utf8Str &strFilter /*= ""*/, uint32_t uFlags /*= 0*/)
4a5d1cb72abd351221a0d5bdce3a01b071f697a9vboxsync LogFlowThisFunc(("strPath=%s, strFilter=%s, uFlags=%x\n",
4a5d1cb72abd351221a0d5bdce3a01b071f697a9vboxsync /* Enclose the state transition NotReady->InInit->Ready. */
4a5d1cb72abd351221a0d5bdce3a01b071f697a9vboxsync /* Start the directory process on the guest. */
4a5d1cb72abd351221a0d5bdce3a01b071f697a9vboxsync procInfo.mName = Utf8StrFmt(tr("Reading directory \"%s\"", strPath.c_str()));
295cafc57090fbc05ed081f4d1907005745afa06vboxsync procInfo.mFlags = ProcessCreateFlag_Hidden | ProcessCreateFlag_WaitForStdOut;
4a5d1cb72abd351221a0d5bdce3a01b071f697a9vboxsync procInfo.mArguments.push_back(Utf8Str("--machinereadable"));
4a5d1cb72abd351221a0d5bdce3a01b071f697a9vboxsync /* We want the long output format which contains all the object details. */
4a5d1cb72abd351221a0d5bdce3a01b071f697a9vboxsync#if 0 /* Flags are not supported yet. */
4a5d1cb72abd351221a0d5bdce3a01b071f697a9vboxsync procInfo.mArguments.push_back(Utf8Str("--nosymlinks")); /** @todo What does GNU here? */
return rc;
return rc;
return S_OK;
return S_OK;
int rc;
return rc;
#ifndef VBOX_WITH_GUEST_CONTROL
uninit();
return S_OK;
#ifndef VBOX_WITH_GUEST_CONTROL
&cbRead);
if (cbRead)
&& exitCode != 0)
switch (rc)
case VERR_ACCESS_DENIED:
hr = setError(VBOX_E_IPRT_ERROR, tr("Reading directory \"%s\" failed: Unable to read / access denied"),
case VERR_PATH_NOT_FOUND:
case VERR_NO_MORE_FILES:
return hr;