133
133
GuestCtrlStreamObjects stdOut;
134
ComPtr<IProgress> pProgress;
134
135
hr = executeAndWaitForTool(Bstr(VBOXSERVICE_TOOL_STAT).raw(), Bstr("Querying file information").raw(),
135
136
ComSafeArrayAsInParam(args),
136
137
ComSafeArrayAsInParam(env),
137
138
aUsername, aPassword,
138
139
ExecuteProcessFlag_WaitForStdOut,
140
NULL /* Progress */, &uPID);
141
pProgress.asOutParam(), &uPID);
141
142
if (SUCCEEDED(hr))
143
int rc = VINF_SUCCESS;
144
hr = setErrorFromProgress(pProgress);
147
int rc = VINF_SUCCESS;
147
/* Dump the parsed stream contents to Log(). */
151
/* Dump the parsed stream contents to Log(). */
150
const char *pszFsType = stdOut[0].GetString("ftype");
151
if (!pszFsType) /* Was an object found at all? */
152
rc = VERR_FILE_NOT_FOUND;
154
&& strcmp(pszFsType, "-")) /* Regular file? */
156
rc = VERR_FILE_NOT_FOUND;
157
/* This is not critical for Main, so don't set hr --
158
* we will take care of rc then. */
161
&& aObjInfo) /* Do we want object details? */
163
rc = executeStreamQueryFsObjInfo(aFile, stdOut[0],
164
aObjInfo, enmAddAttribs);
154
const char *pszFsType = stdOut[0].GetString("ftype");
155
if (!pszFsType) /* Was an object found at all? */
156
rc = VERR_FILE_NOT_FOUND;
158
&& strcmp(pszFsType, "-")) /* Regular file? */
160
rc = VERR_FILE_NOT_FOUND;
161
/* This is not critical for Main, so don't set hr --
162
* we will take care of rc then. */
165
&& aObjInfo) /* Do we want object details? */
167
rc = executeStreamQueryFsObjInfo(aFile, stdOut[0],
168
aObjInfo, enmAddAttribs);
174
181
catch (std::bad_alloc &)