Name

VMGetSharedFolderState

Description

($err, $folderFlags, $folderName, $folderHostPath) = VMSetSharedFolderState($vmHandle,
                                                                            $index);

This function returns the state of a shared folder mounted in the virtual machine.

Parameters

vmHandle
Identifies a virtual machine. Call VMOpen() to create a virtual machine handle.
index
Identifies the shared folder.

Return Value

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

$folderFlags. Flags describing the folder options VIX_SHAREDFOLDER_WRITE_ACCESS

$folderName. The name of the folder.

$folderHostPath. The host path the folder is mounted from.

Remarks

Side Effects

None.

Requirements

use VMware::Vix::Simple;
use VMware::Vix::API::Constants;
since VMware Workstation 6.0

Example

my $err;
my $numSharedFolders;
my $folderName;
my $folderHostPath;
my $folderFlags;
my $i;

($err, $numSharedFolders) = VMGetNumSharedFolders($vmHandle);
die "VMGetNumSharedFolders() failed, $err ", GetErrorText($err), "\n" if $err != VIX_OK;

for ($i = 0; $i < $numSharedFolders; $i++) {
   ($err, $folderFlags, $folderName, $folderHostPath) = VMGetSharedFolderState($vmHandle, $i);
   die "VMGetSharedFolderState() failed, $err ", GetErrorText($err), "\n" if $err != VIX_OK;

   print "Folder #$i: $folderHostPath:$folderName, $folderFlags\n";
   
}

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