# Name

VixVM_GetFileInfoInGuest

# Description

    VixHandle
    VixVM_GetFileInfoInGuest(VixHandle vmHandle,
                             const char *pathname,
                             VixEventProc *callbackProc,
                             void *clientData);

This function returns information about a file in the guest operating system.

# Parameters

vmHandle
  Identifies a virtual machine. Call VixVM_Open() to create a virtual machine handle.
pathname
  The path name of the file in the guest.
callbackProc
  A callback function that will be invoked when the operation is complete.
clientData
  A parameter that will be passed to the callbackProc function.

# Return Value

VixHandle. A job handle that describes the state of this asynchronous operation.

# Remarks

- You must call VixVM_LoginInGuest() before calling this function.
- When the job is signaled, the following list of properties will be available on the returned job handle:
  - VIX_PROPERTY_JOB_RESULT_FILE_SIZE: file size as a 64-bit integer. This is 0 for directories.
  - VIX_PROPERTY_JOB_RESULT_FILE_FLAGS: file attribute flags. The flags are:
    - VIX_FILE_ATTRIBUTES_DIRECTORY - Set if the pathname identifies a directory.
    - VIX_FILE_ATTRIBUTES_SYMLINK - Set if the pathname identifies a symbolic link file.
  - VIX_PROPERTY_JOB_RESULT_FILE_MOD_TIME: The modification time of the file or directory as a 64-bit integer specifying seconds since the epoch.
- Only absolute paths should be used for files in the guest; the resolution of relative paths is not specified.

# Side Effects

None.

# Requirements

vix.h, since VMware Workstation 6.5
Minimum Supported Guest OS: Microsoft Windows NT Series, Linux

# Example

    int fileFlags;
    int64 fileSize;

    job = VixVM_GetFileInfoInGuest(vm, guestFile, NULL, NULL);
    err = VixJob_Wait(job, VIX_PROPERTY_NONE);
    if (VIX_OK != err) {
       fprintf(stderr, "failed to get file info for '%s' in vm '%s'(%"FMT64"d %s)\n",
               guestFile, vmpath, err, Vix_GetErrorText(err, NULL));
       goto abort;
    }

    err = Vix_GetProperties(job,
                            VIX_PROPERTY_JOB_RESULT_FILE_FLAGS,
                            &fileFlags,
                            VIX_PROPERTY_JOB_RESULT_FILE_SIZE,
                            &fileSize,
                            VIX_PROPERTY_NONE);

    Vix_ReleaseHandle(job);

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