NDSm::NWServer


new

Creates a new Server object. If you aren't connected, then this object tries to make a new connection to the file server.
You should call the method IsInit() to find out if the connection was made successfully.
If no previous connection to the server was made this class set up a UNLICENSED connection because a lot of the methods don't require you to be licensed.
If you need to be licensed you should call the member method LicenseConn() which will enable you to read/write files and print documents.
You can create directories (4.11) without beeing licensed.
Returns a NWServer object on success or undef on failure.
Example:
$Server = new NDSm::NWServer($ServerName);

AddTrustee

Add a trustee to a file or directory. $Path is full path with volumename: (SYS:SYSTEM/LOG). $ObjectId is the Id returned from MapNameToID(). @RightsMask letters which is 'ORed' together. example: (``RF'')
Possible values for rightsMask is: ``SRWECMFA''
Returns 0 on success, Netware error code on failure.
Example:
$ErrCode = $Server->AddTrustee($not_used, $Path, $ObjectID, $RightsMask);

AuthenticateConn

This method authenticates the server connection. Maybe we should authenticate as part of initializing this class?. For now we have to call it manualy. If the connection already is authenticated we still return success.
Returns 0 on success, Netware error code on failure.
Example:
$Val = $Server->AuthenticateConn($Context)

CheckConsolePrivileges

CheckConsolePrivileges() determines if the logged-in user is a console operator.
Some return values include:
0 SUCCESSFUL
34817 INVALID_CONNECTION
35270 NO_CONSOLE_PRIVILEGES
Returns 0 is console operator, Netware error code is not.
Example:
$Retval = $Server->CheckConsolePrivileges();

CreateDirectory

Create a directory on a Netware server. set $dirHandle to 0. $dirPath is the full path to a existing directory: eg. SYS:ETC\. $accessMask is a string containing one or more of the following strings: READ, WRITE, OPEN, CREATE, DELETE, OWNER, SEARCH, MODIFY, ALL.
Returns 0 on success, Netware error code on failure.
Example:
$Retval = $Server->CreateDirectory($dirHandle, $dirPath, $accessMask);

Debug

This method set the internal debugging of a class to a given level. Only 0 and and 1 are in use in version 1.00.
Example:
$Server->Debug($DebugLevel);

DeleteDirectory

Delete a directory on a Netware server. $dirHandle should be 0. $dirPath is the full name w/volume.
Returns 0 on success, Netware error code on failure.
Example:
$Retval = $Server->DeleteDirectory($dirHandle, $dirPath);

DeleteTrustee

Delete a object from the trustee list for a file/directory. $dirHandle should be 0. $dirPath is the full path w/volume. $ObjectID is a server supplied number. Use MapNameToID() to get this id.
Returns 0 on success, Netware error code on failure.
Example:
$Retval = $Server->DeleteTrustee($dirHandle, $dirPath, $ObjectID);

DisableFileServerLogin

Tells the server to stop accepting logins, workstations can connect though. You must have console operator rights. to use this method. See CheckConsolePrivileges().
Returns 0 on success, Netware error code on failure.
Example:
$Retval = $Server->DisableFileServerLogin();

DownFileServer

This very handy methods downs the server which name was used to create this class. If $forceFlag is 0 the server will shut down even if files are open. You must have console operator rights to use this method. You should use CheckConsolePrivileges() to check if you have privileges to use this method.
Returns 0 on success, Netware error code on failure.
Example:
$Retval = $Server->DownFileServer($forceFlag);

EnableFileServerLogin

Instructs the server to begin accepting new login requests from clients. You must have console operator rights to Enable login..
Returns 0 on success, Netware error code on failure.
Example:
$Retval = $Server->EnableFileServerLogin();

GetHandle

Returns the handle to a server connection. The value returned is just a number, so you can put it directly into an scalar and feed it to all methods that require the connection-handle.
Example:
$ConnHandle = $Server->GetHandle();

ExecuteNCFFile

Tell the server to execute the .NCF (batch) file given in $FileName. The file must reside on one of the fileservers volumes.
Returns 0 on success, Netware error code on failure.
Example:
$Retval = $Server->ExecuteNCFFile($FileName);
 

GetExtendedVolumeInfo

This method get all info about a given volumenumber on this server. $volNum can be retieved by calling GetVolumeNumber("VOLNAME").

Returns a array with the following values:
0 volType 12 numDataStreams 24 clustersUsedByExtDirs
1 statusFlag 13 numLimboDataStreams 25 totalDirEntries
2 sectorSize 14 oldestDelFileAgeInTicks 26 unusedDirEntries
3 sectorsPerCluster 15 numCompressedDataStreams 27 totalExtDirExtants
4 volSizeInClusters 16 numCompressedLimboDataStreams 28 unusedExtDirExtants
5 freeClusters 17 numNoncompressibleDataStreams 29 extAttrsDefined
6 subAllocFreeableClusters 18 precompressedSectors 30 extAttrExtantsUsed
7 freeableLimboSectors 19 compressedSectors 31 DirectoryServicesObjectID
8 nonfreeableLimboSectors 20 numMigratedDataStreams 32 volLastModifiedDateAndTime
9 availSubAllocSectors 21 migratedSectors
10   nonuseableSubAllocSectors 22 clustersUsedByFAT
11 subAllocClusters 23 clustersUsedByDirs
Returns undef on error, in which case you can use LastErr() to get the netware error-code.
Example:
@volInfo = $Server->GetExtendedVolumeInfo($volNum);


GetObjDiskRestrictions

Get the diskrestriction for a given object on a volume.
The resturned array includes two fields:
0 : Restriction set on volume for this object.
1 : Currently used space by this object.
Returns undef on error, in which case you can use LastErr() to get the netware error-code.
Example:
@DiskRestriction = $Server->GetObjDiskRestrictions($volNum, $objID);

GetSetCommandValue

Returns the value of the given set command on the fileserver. Use this for both strings and numbers (ON/OFF included).
Returns undef on error, in which case you can use LastErr() to get the netware error-code.
Example:
$SetValue = $Server->GetSetCommandValue($setCommand);

GetVolumeName

Retrieve the volumename for a given volumenumber.
Returns undef on error, in which case you can use LastErr() to get the netware error-code.
Example:
$VolName = $Server->GetVolumeName($VolumeNumber);

GetVolumeNumber

Retrieve the volumeunmber for a given volumename.
Returns undef on error, in which case you can use LastErr() to get the netware error-code.
If a volume with given name don't exists on this server the LastErr() will return 0x8998 as error-number.
Example:
$VolNumber = $Server->GetVolumeNumber($VolumeName);

IsInit

You can use IsInit() to find out if the connection to the server is created and initialized as it should be.
Returns 1 if set up correctly, 0 if not.
Example:
$Val = $Server->IsInit();
 

LastErr

Return the last error-number from $Server. The error-number is an Netware server error which is described if you press <F1> in NWadm* and search for 'Error'.
Example:
$Err = $Server->LastErr();

LicenseConn

License the current server connection. (Removes the * in front of your connection in monitor.nlm.) I manage to create directories without using this though.
Returns 0 on success, Netware error code on failure.
Example:
$ErrCode = $Server->LicenseConn();

LoadNLM

Load a NLM on this server.
The $LoadCmd has the format: {VOLUME NAME:} {PATH\...} NLMname{.ext}{parameters}
Returns 0 on success, Netware error code on failure.
Example:
$ErrCode = $Server->LoadNLM($Loadcmd);

MapNameToID

Map a NDS object name to a objectId which can be used in server-centered methods, like adding trustees to a volume directory. This ID is local to this server and may not be valid later.
Returns undef on error, in which case you can use LastErr() to get the netware error-code.
Example:
$Id = $Server->MapNameToID($Context, $ObjectName);

SetDynamicCmdIntValue

Change the current value of a SET value on the fileserver. (integer values). The value is set back if the server is rebooted, ie. using this method does not change autoexec.ncf or startup.ncf. You must have console operator rights to successfully use this method. ON/OFF are 1 and 0 respectively.
Returns 0 on success, Netware error code on failure.
Example:
$Retval = $Server->SetDynamicCmdIntValue($commandName, $commandValue);

SetDynamicCmdStrValue

Change the current value of a SET value on the fileserver. (string values). The value is set back if the server is rebooted, ie. using this method does not change autoexec.ncf or startup.ncf. You must have console operator rights to use this method. The SET values ON/OFF are treated as the integers 1 and 0 respectively, and should be set with SetDynamicCmdIntValue().
Returns 0 on success, Netware error code on failure.
Example:
$ErrCode = $Server->SetDynamicCmdStrValue($commandName, $commandValue);

SetObjectVolSpaceLimit

Set the maximum space a object can use on a Netware server volume. $VolNum is a number you can get from GetVolumeNumber(). $ObjectID is a value returned from MapNameToID(). $Max is the maximum space this object can use on given volume, in MB. If the restriction is greater than  4294968 on a 3.1 server or  8589935 on a 4.x server, the object has no restrictions. This numbers are from the SDK, they seem to large for me...
Returns 0 on success, Netware error code on failure.
Example:
$Retval = SetObjectVolSpaceLimit($volNum, $ObjectID, $Max);

UnloadNLM

Unloads the NLM given in $NLMName. The $NLMName has the format: NLMname{.ext}.
ext defaults to NLM.
Returns 0 on success, Netware error code on failure.
Example:
$Retval = $Server->UnloadNLM($NLMName);
 
 

SEE ALSO

the NDSContext class

the Misc help file

the Buf_T class

the NDSm help file

the Audit class

http://www.ahs.hist.no/distr/NDSm/
 


COPYRIGHT

  Copyright (c) Steinar Kleven 1997.
  All rights reserved.