use NDSm::NWServer;
$Server = new NDSm::NWServer($ServerName);
Then you should use the methods outlined below. One of the features includes downing a server. This is NOT an Netware compatible SERVER, but an interface to an existing Netware server. Do I have to say that??? If I could write a Netware server in less than 100 Kb (Loadable's size) I would be rich. Look in the t/ directory for examples.
This extension enables you to work with Novell NetWare servers from perl 5.004 or higher. You should get the NWSDK with same version as this module from http://developer.novell.com to understand what each method do.
Creates a new Server object. If you aren't connected, then this object tries to make a new connection to the file server. You shoul 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 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.
This method set the internal debugging of a class to a given level. uhmmm, Only 0 and and 1 are in use in version 0.13.03.
This method is used internally to initialize things. You should normaly never use this directly. This method is called by new().
You can use IsInit() to find out if the connection to the server is created and initialized as it should be.
Add a trustee to a file or directory. $Path is full path with volumename: SYS:SYSTEM/LOG. $ObjectId is the Id returned from $Server->MapNameToID(). @RightsMask is a array of string constants values which is ORed together. example: ("TR_ERASE", "TR_READ") Possible values for rightsMask is: TR_NONE, TR_READ, TR_WRITE, TR_OPEN, TR_DIRECTORY, TR_CREATE, TR_DELETE TR_ERASE, TR_OWNERSHIP, TR_ACCESS_CTRL, TR_FILE_SCAN, TR_SEARCH TR_FILE_ACCESS, TR_MODIFY, TR_ALL, TR_SUPERVISOR, TR_NORMAL Returns 0 on success.
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.
CheckConsolePrivileges determines if the logged-in user is a console operator. Some return values include: 0 SUCCESSFUL 34817 INVALID_CONNECTION 35270 NO_CONSOLE_PRIVILEGES
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;
Delete a directory on a Netware server. $dirHandle should be 0. $dirPath is the full name w/volume. Returns 0 on success.
Delete a object from the trustee list for a file/directory. $dirHandle should be 0. $dirPath is the full name w/volume. $ObjectID is a server supplied number. Use $Server->MapNameToID() Returns 0 on success.
Tells the server to stop accepting logins, workstations can connect though. You must have console operator rights. to use this method. See $Server->CheckConsolePrivileges(). returns 0 on success.
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 $Server->CheckConsolePrivileges() check this. Returns 0 on success.
Instructs the server to begin accepting new login requests from clients. You must have console operator rights. returns 0 on succcess.
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.
This metod get all info about a given volumenumber on this server. $volNum can be retieved by calling $Server->GetVolumeNumber(<VOLNAME>). Returns undef on failure. Returns a table with the following values (All vaulues are numbers): index: Value: 0 volType 1 statusFlag 2 sectorSize 3 sectorsPerCluster 4 volSizeInClusters 5 freeClusters 6 subAllocFreeableClusters 7 freeableLimboSectors 8 nonfreeableLimboSectors 9 availSubAllocSectors 10 nonuseableSubAllocSectors 11 subAllocClusters 12 numDataStreams 13 numLimboDataStreams 14 oldestDelFileAgeInTicks 15 numCompressedDataStreams 16 numCompressedLimboDataStreams 17 numNoncompressibleDataStreams 18 precompressedSectors 19 compressedSectors 20 numMigratedDataStreams 21 migratedSectors 22 clustersUsedByFAT 23 clustersUsedByDirs 24 clustersUsedByExtDirs 25 totalDirEntries 26 unusedDirEntries 27 totalExtDirExtants 28 unusedExtDirExtants 29 extAttrsDefined 30 extAttrExtantsUsed 31 DirectoryServicesObjectID 32 volLastModifiedDateAndTime
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 by this object. Returns undef on failure.
Retieve the volumename for a given volumenumber. This method return undef if the given volumenumber don't exists or isn't mounted or if the call failed.
Retieve the volumeunmber for a given volumename. This method return undef if an error accured. If a volume with given name don't exists on this server the $server->LastErr() will give 0x8998 as error-number.
License the current server connection. (Removes the * in front of connection in monitor.) I manage to create directories without using this though. Returns 0 on success.
Load a NLM on this server. The $LoadCmd has the format: {VOLUME NAME:}{PATH\...}NLMname{.ext}{parameters} Returns 0 on success.
Map a NDS object name to a objectId which can be used in server-centered methods, like adding trustees to a volume directory. returns undef on failure.
Set the maximum space a object can use on a Netware server volume. $VolNum is a number you can get from $Server->NWGetVolumeNumber(). $ObjectID is a value returned from $Server->MapNameToID(). $Max is the maximum space this object can use on given volume, in MB. If the restriction is greater than 160 000 on a 3.1 server or 320 000 on a 4.x server, the object has no restrictions. Returns 0 on success.
Unloads the NLM given in $NLMName. The $NLMName has the format: NLMname{.ext} ext defaults to NLM. Returns 0 on success.
http://www.ahs.hist.no/distr/NDSm/
Copyright (c) Steinar Kleven 1997. All rights reserved.
Steinar Kleven, mailto:Steinar.Kleven@ahs.hist.no