122
122
args.push_back(Bstr(Utf8Directory).raw()); /* The directory we want to create. */
124
rc = executeAndWaitForTool(Bstr(VBOXSERVICE_TOOL_MKDIR).raw(), Bstr("Creating directory").raw(),
125
ComPtr<IProgress> pProgress;
126
hr = executeAndWaitForTool(Bstr(VBOXSERVICE_TOOL_MKDIR).raw(), Bstr("Creating directory").raw(),
125
127
ComSafeArrayAsInParam(args),
126
128
ComSafeArrayAsInParam(env),
127
129
aUsername, aPassword,
128
130
ExecuteProcessFlag_None,
130
NULL /* Progress */, NULL /* PID */);
132
pProgress.asOutParam(), &uPID);
135
hr = setErrorFromProgress(pProgress);
132
139
catch (std::bad_alloc &)
298
305
if (it != mGuestDirectoryMap.end())
301
it->second.mStream.Dump("/tmp/stream.txt");
308
it->second.mStream.Dump("c:\\temp\\stream.txt");
303
310
return executeStreamGetNextBlock(it->second.mPID,
304
311
ProcessOutputFlag_None /* StdOut */,
481
488
* Execute guest process.
491
ComPtr<IProgress> pProgress;
484
492
GuestCtrlStreamObjects stdOut;
485
493
hr = executeAndWaitForTool(Bstr(VBOXSERVICE_TOOL_STAT).raw(), Bstr("Querying directory information").raw(),
486
494
ComSafeArrayAsInParam(args),
488
496
aUsername, aPassword,
489
497
ExecuteProcessFlag_WaitForStdOut,
490
498
&stdOut, NULL /* stdErr */,
491
NULL /* Progress */, &uPID);
499
pProgress.asOutParam(), &uPID);
492
500
if (SUCCEEDED(hr))
494
int rc = VINF_SUCCESS;
502
hr = setErrorFromProgress(pProgress);
497
const char *pszFsType = stdOut[0].GetString("ftype");
498
if (!pszFsType) /* Attribute missing? */
499
rc = VERR_PATH_NOT_FOUND;
501
&& strcmp(pszFsType, "d")) /* Directory? */
503
rc = VERR_PATH_NOT_FOUND;
504
/* This is not critical for Main, so don't set hr --
505
* we will take care of rc then. */
508
&& aObjInfo) /* Do we want object details? */
510
rc = executeStreamQueryFsObjInfo(aDirectory, stdOut[0],
511
aObjInfo, enmAddAttribs);
505
int rc = VINF_SUCCESS;
508
const char *pszFsType = stdOut[0].GetString("ftype");
509
if (!pszFsType) /* Attribute missing? */
510
rc = VERR_PATH_NOT_FOUND;
512
&& strcmp(pszFsType, "d")) /* Directory? */
514
rc = VERR_PATH_NOT_FOUND;
515
/* This is not critical for Main, so don't set hr --
516
* we will take care of rc then. */
519
&& aObjInfo) /* Do we want object details? */
521
rc = executeStreamQueryFsObjInfo(aDirectory, stdOut[0],
522
aObjInfo, enmAddAttribs);
521
535
catch (std::bad_alloc &)