Name

VixJob_GetNthProperties

Description

VixError
VixJob_GetNthProperties(VixHandle jobHandle,
                        int index,
                        int propertyID,
                        ...);

Retrieves the property at a specific index in a list. You can use this to iterate through returned property lists.

Parameters

VixHandle
The handle of a job object, returned from any asynchronous Vix function.
index
Index into the property list of the job object.
propertyID
A property ID.

Return Value

VixError. The result returned by a completed asynchronous function.

Remarks

Side Effects

None.

Requirements

vix.h, since Workstation 6.0.

Example

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);

Copyright (C) 2007-2010 VMware, Inc. All rights reserved.