Please address the following problems I am facing...
Articles and Tips: qna
01 Aug 2002
Q.
Please address the following problems I am facing while fetching certain information. I am using the CLIB SDK.
I need to obtain the following information for any given directory, such as SYS:SYSTEM:
Current Size (in Kbytes)
Number of files
Number of Sub-Directories
I have tried using the call NWGetDirSpaceInfo and although it gives the correct size for volume-wide information, it does not give it for a specific directory in the volume.
I also need to obtain the size of a specified file-- for example, SYS:SYTEM\SNMP.NLM. I tried using NWIntScanFileInformation(with filepath parameter containing the entire path) but I always get a VOLUME_DOES_NOT_EXIST error. What functions can I use to obtain the desired information?
Another problem I am facing is when using the NWGetDefaulConnRef function. I get a linker Error "Undefined Reference," even though I am importing the calnlm32.imp file.
I want a list of NLMs loaded on the server. NWGetNLMLoadedList and NWGetNLMInfo provide all desired information except NLMID. For obtaining NLMID I used FindNLMHandle and GetNLMIDFromNLMHandle functions.
Any pointers or answers to these questions will be greatly appreciated!
A.
For the first question, I'd do this with opendir()/readdir()/closedir().
Regarding your second question, this function is neither defined in the import files nor exported by the Operating System. I think it is not available for NLMs at all, only for Win32 applications. This seems logical because Windows typically has a default connection (you log in to the network before running your programs), but NetWare does not have it (because you don't have to log in to access the console). Maybe NWDSLoginAsServer() can replace that function for you. The CLIB documentation probably should be updated to indicate this.
For your third question, NLM IDs should be unique, but NLM names are not if you load the same NLM more than once into different protected address spaces. FindNLMHandle() will not give you all the IDs in this case.
* Originally published in Novell AppNotes
Disclaimer
The origin of this information may be internal or external to Novell. While Novell makes all reasonable efforts to verify this information, Novell does not make explicit or implied claims to its validity.