Name

VMListDirectoryInGuest

Description

($err, @directoryContents) = VMListDirectoryInGuest($vmHandle,
                                                    $pathname,
                                                    $options);

This function lists a directory in the guest operating system.

Parameters

vmHandle
Identifies a virtual machine. Call VMOpen() to create a virtual machine handle.
pathname
The path name of a directory to be listed.
options
Must be 0.

Return Value

$err. The error code returned by the operation. For returned values, see Topics > Error Codes.

@directoryContents. An array of hashes containing the directory information.

Remarks

Side Effects

None.

Requirements

use VMware::Vix::Simple;
use VMware::Vix::API::Constants;
since VMware Workstation 6.0
Minimum Supported Guest OS: Microsoft Windows NT Series, Linux

Example

$(err, @directoryContents) = VMListDirectoryInGuest($vmHandle, $pathname, 0);
die "VMListDirectoryInGuest() failed, $err ", GetErrorText($err), "\n" if $err != VIX_OK;

my $num = @directoryContents;
my $i;

foreach $i (1..$num) {
   print "file: $directoryContents[$i-1]{'FILE_NAME'}\t";
   print "flags: $directoryContents[$i-1]{'FILE_ATTRIBUTES'}\t";
}

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