From:	MERC::"uunet!CRVAX.SRI.COM!RELAY-INFO-VAX" 23-JUN-1992 02:05:06.04
To:	INFO-VAX@SRI.COM
CC:	
Subj:	Disk Display Utility

Ok, here's another nice little utility I have. The original idea came from
DECprofessional; however, it has been modified so much that one could say it
has been rewritten. The utility graphically displays the amount of space on a
disk graphically.

Hope it is useful,
Tom

-----
Tom Ohlendorf, Programmer/Analyst  Towson State University          
HRS Advisory Committee             Administration Building, Room 128
INTERNET: D7AP002@TOA.TOWSON.EDU   Towson, MD 21204                 
VOICE: (410) 830-3642 FAX: (410) 830-3476 CSN: TSUPER01               

---------------------------------Cut Here---------------------------------------
$!	DISK_DISPLAY.COM - GRAPHIC DISPLAY OF DISK USAGE
$ 	WRITE SYS$OUTPUT "[0;0f"
$ 	WRITE SYS$OUTPUT "[2J"
$ 	V = F$VERIFY(0)
$	NORM[0,32] = %X6D305B1B
$	BOLD[0,32] = %X6D315B1B
$	WRITE SYS$OUTPUT F$FAO("!20<Disk Device!> !50*-")
$       LOOPCOUNT = 2
$LOOP:
$       IF LOOPCOUNT .GT. 22
$          THEN
$             WAIT 00:00:05
$ 	      WRITE SYS$OUTPUT "[0;0f"
$ 	      WRITE SYS$OUTPUT "[2J"
$	      WRITE SYS$OUTPUT F$FAO("!20<Disk Device!> !50*-")
$             LOOPCOUNT = 2
$           ELSE
$             LOOPCOUNT = LOOPCOUNT + 1
$       ENDIF
$       DISK = F$DEVICE(,"DISK")
$       IF DISK .EQS. "" THEN EXIT
$	IF .NOT. F$GETDVI(DISK,"MNT") THEN GOTO LOOP
$ 	LOGVOLNAM = F$GETDVI(DISK,"LOGVOLNAM")
$	MEDIA_NAME = F$GETDVI(DISK,"MEDIA_NAME") 
$	FREEBLOCKS = F$GETDVI(DISK,"FREEBLOCKS") 
$	MAXBLOCK   = F$GETDVI(DISK,"MAXBLOCK") 
$       IF MAXBLOCK .EQ. 0 
$          THEN 
$             PERCENT = 0
$          ELSE
$	      PERCENT    = (MAXBLOCK - FREEBLOCKS) * 100 / MAXBLOCK
$       ENDIF
$	IF PERCENT .GE.  0 THEN PERCENT_BAR = F$FAO("!#*|",PERCENT/2)
$	IF PERCENT .LT.  0 THEN PERCENT_BAR = BOLD + "Device Error" + NORM
$	IF PERCENT .GE. 70 THEN PERCENT_BAR = BOLD + PERCENT_BAR + NORM
$	WRITE SYS$OUTPUT -
 	      F$FAO("!20<!AS !AS !> !AS!UL%", -
 	      MEDIA_NAME, LOGVOLNAM, PERCENT_BAR, PERCENT)
$	GOTO LOOP
---------------------------------Cut Here---------------------------------------

