IBM OS/2 LAN Server REXX Utility DLL


Inf-HTML [About][Toc][Index] 0.9b (c) 1995 Peter Childs


NETUSE Get Info


The function retrieves information about a connection to a shared 
resource.   
Syntax 

MyRc = NetGetInfo(NETUSE, 'useInfo', SrvName, NetworkName)

  
Parameters 
The parameters specified are: 
'useInfo'         The REXX variable receiving the result. The variable is 
                  divided into: 
   o useInfo.local 
     The local device name being redirected to the shared resource 
   o useInfo.remote 
     The UNC name of the remote resource being accessed The string has the 
     following form \\servername\netname 
   o useInfo.password 
     This value is not available (N/A) 
   o useInfo.status 
     The status of the connection 
   o useInfo.asg_type 
     The resource type 
   o useInfo.refcount 
     The number of files, directories, and other processes that are open 
     on the remote resource 
   o useInfo.usecount 
     The number of uses 
SrvName           The server computer name 
NetworkName       The network name 
   o If the connection is a device name connection, then the name 
     specified must be the name of the local device 
   o If the connection is a UNC connection, then the name specified must 
     be the UNC name 
  
Note 
The server computer name can be specified as '' for a local server or 
computer.   
Example   

/* Get net use information */
call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs'
call LoadLsRxutFuncs

NETUSE      = 270
SrvName     = '\\FSC30DCR'
NetworkName = 'T:'

myRc = NetGetInfo(NETUSE, 'useInfo', SrvName, NetworkName)

if myRc <> '0' then do
 say 'Got error from NetGetInfo() ' myRc
 call DropLsRxutFuncs
 exit 9
end

say
say 'Local device name: ' useInfo.local
say 'UNC name:          ' useInfo.remote
say 'Password:          ' useInfo.password
say 'Connection status: ' useInfo.status
say 'Resource type:     ' useInfo.asg_type
say 'Open count:        ' useInfo.refcount
say 'Number uses:       ' useInfo.usecount

call DropLsRxutFuncs
call RxFuncDrop 'LoadLsRxutFuncs'

exit 0

  
Example Output   

Local device name:  T:
UNC name:           \\FSC30DCR\FORALL
Password:           N/A
Connection status:  Connection valid
Resource type:      Disk device
Open count:         1
Number uses:        1



Inf-HTML End Run - Successful