home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam    

19.11 Win32::NetResource

The Win32::NetResource module allows you to manage shared resources on a network, such as printers, disks, etc. Two data structures are used to provide or store information for many of the NetResource functions. The first is the share_info hash. This hash contains parameters for setting up a share, using the following structure:

%share_info = (
      netname       => "
name of share
      type          => "
type of share
      remark        => "
a string comment
      permissions   => "
permissions value
      maxusers      => "
the max number of users
      current-users => "
the current number of users
      path          => "
the path of the share
      passwd        => "
password, if required
A netresource data structure contains information about the shared resource or device. It has the following structure:
%netresource = (
      'Scope'       => "
Scope of a resource connection (see table below for 
      'Type'        => "
The type of resource (see table below)
      'DisplayType' => "
How the resource should be displayed (see table 
      'Usage'       => "
How the resource should be used
      'LocalName'   => "
Name of the local device the resource is connected 
      'RemoteName'  => "
Network name of the resource
      'Comment'     => "
Comment string
      'Provider'    => "
Provider of the resource
The first three elements of the netresource hash contain values described in the following tables. The Scope value can be one of the following:
Resource is already connected.

Resource is reconnected each time the user logs on.

Resource is available to the entire network.
The Type element takes one of the following values:
All resources

Disk resources

Print resources
The Display element can be one of these values:
The object is displayed as a domain. 

The object is displayed as a server.

The object is displayed as a sharepoint.

The resource can be connected to a local device.

The resource contains more resources.
The functions in Win32::NetResource use the share_info and netresource structures as input and output arguments. These arguments are used in the description of the functions below; you should name them whatever you want.