int
VixJob_GetNumProperties(VixHandle jobHandle,
int resultPropertyID);
Retrieves the number of instances of the specified property. Used to work with returned property lists.
job = VixVM_ListDirectoryInGuest(vm, guestdir, 0, NULL, NULL);
err = VixJob_Wait(job, VIX_PROPERTY_NONE);
if (VIX_OK != err) {
fprintf(stderr, "failed to list dir '%s' in vm '%s'(%"FMT64"d %s)\n",
guestdir, vmpath, err, Vix_GetErrorText(err, NULL));
goto abort;
}
num = VixJob_GetNumProperties(job, VIX_PROPERTY_JOB_RESULT_ITEM_NAME);
for (i = 0; i < num; i++) {
char *fname;
err = VixJob_GetNthProperties(job,
i,
VIX_PROPERTY_JOB_RESULT_ITEM_NAME,
&fname,
VIX_PROPERTY_NONE);
printf("file #%d '%s'\n", i, fname);
Vix_FreeBuffer(fname);
}
Vix_ReleaseHandle(job);