home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Support Encyclopedia 96-1
/
novell-nsepro-1996-1-cd2.iso
/
download
/
netware
/
dirnfo.exe
/
DIRINFO.C
next >
Wrap
C/C++ Source or Header
|
1994-11-28
|
2KB
|
84 lines
#define NWDOS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <nwcalls.h>
void main(int argc, char *argv[])
{
NWCCODE ccode;
NWCONN_HANDLE connHandle;
char *ptr;
NWDIR_HANDLE dirHandle;
NWVOL_NUM volNumber;
DIR_SPACE_INFO spaceInfo;
int i;
char volName[200];
NWNUMBER totalBlocks;
NWNUMBER sectorsPerBlock;
NWNUMBER availableBlocks;
NWCONN_HANDLE newConn;
char newPath[200];
long temp;
if (argc < 3)
{
printf ("\nUsage: DIRINFO ServerName VolumeNumber\n\n");
return;
}
for (i = 0; i < argc; i++)
strupr (argv[i]);
volNumber = atoi (argv[2]);
ccode = NWCallsInit(NULL, NULL);
ptr = strupr(argv[1]); /* Convert Server Name to upper case */
ccode = NWGetConnectionHandle(ptr, 0, &connHandle, 0);
ccode = NWGetDirSpaceInfo (connHandle,
0,
volNumber,
&spaceInfo);
if (ccode == 0)
{
printf ("\nVolume Name: %s", spaceInfo.volName);
printf ("\nNWGetDirSpaceInfo");
printf ("\nTotal Space: %ld K",
(spaceInfo.totalBlocks * spaceInfo.sectorsPerBlock)
/ 2);
printf ("\nFree Space: %ld K",
(spaceInfo.availableBlocks * spaceInfo.sectorsPerBlock)
/ 2);
printf ("\nPurgeable: %ld K",
(spaceInfo.purgeableBlocks * spaceInfo.sectorsPerBlock)
/ 2);
printf ("\nSectors per Block: %d", spaceInfo.sectorsPerBlock);
}
printf ("\n\nNWGetVolumeInfoWithNumber");
ccode = NWGetVolumeInfoWithNumber (connHandle,
volNumber,
volName,
&totalBlocks,
§orsPerBlock,
&availableBlocks,
NULL,
NULL,
NULL);
if (ccode == 0)
{
temp = (long) totalBlocks * (long) sectorsPerBlock / 2;
printf ("\nTotal Space: %ld K", temp);
temp = (long) availableBlocks * (long) sectorsPerBlock / 2;
printf ("\nFree Space: %ld K", temp);
printf ("\nSectors per Block: %d", sectorsPerBlock);
}
}