From: VANCE%TOYVAX@ARIZONA.EDU (From my mind to your mind)
Newsgroups: comp.os.vms
Subject: Updated DISKFREE.COM
Date: 14 Dec 92 02:51:04 GMT
Distribution: world
Organization: The Internet


  Many months ago the following comand file was floating on
  INFO-VAX/comp.os.vms.  I've updated DISKFREE.COM to identify
  disk devices supported up through VMS V5.5-2 as well as an
  "ALL" option (which needs at least VMS V5.2) that lists all
  drives on the system.  It is included after my signature.


Vance Haemmerle                         vance@vips.lpl.arizona.edu
Support Systems Analyst, Sr.              vance%toyvax@arizona.edu
Lunar & Planetary Lab
University of Arizona

----------------------------- CUT HERE ---------------------------
$!
$!	DISKFREE.COM	Command procedure to show disk space usage
$!
$!		P1 = Disk name (default is system disk)
$!		   = "ALL" uses F$DEVICE to get list of disks
$!
$!      Disk device names from $DCDEF macro (VMS Version 5.5-2)
$!
$D1	= "RK06"
$D2	= "RK07"
$D3	= "RP04"
$D4	= "RP05"
$D5	= "RP06"
$D6	= "RM03"
$D7	= "RP07"
$D8	= "RP07HT"
$D9	= "RL01"
$D10	= "RL02"
$D11	= "RX02"
$D12	= "RX04"
$D13	= "RM80"
$D14	= "TU58"
$D15	= "RM05"
$D16	= "RX01"
$D17	= "ML11"
$D18	= "RB02"
$D19	= "RB80"
$D20	= "RA80"
$D21	= "RA81"
$D22	= "RA60"
$D23	= "RC25"
$D24	= "RCF25"
$D25	= "RD51"
$D26	= "RX50"
$D27	= "RD52"
$D28	= "RD53"
$D29	= "RD26"
$D30	= "RA82"
$D31	= "RD31"
$D32	= "RD54"
$D33	= "CRX50"
$D34	= "RRD50"
$D35	= "GENERIC_DU"
$D36	= "RX33"
$D37	= "RX18"
$D38	= "RA70"
$D39	= "RA90"
$D40	= "RD32"
$D41	= "DISK9"
$D42	= "RX35"
$D43	= "RF30"
$D44	= "RF71"
$D45	= "RD33"
$D46	= "ESE20"
$D47	= "TU56"
$D48	= "RZ22"
$D49	= "RZ23"
$D50	= "RZ24"
$D51	= "RZ55"
$D52	= "RRD40S"
$D53	= "RRD40"
$D54	= "GENERIC_DK"
$D55	= "RX23"
$D56	= "RF31"
$D57	= "RF72"
$D58	= "RAM_DISK"
$D59	= "RZ25"
$D60	= "RZ56"
$D61	= "RZ57"
$D62	= "RX23S"
$D63	= "RX33S"
$D64	= "RA92"
$D65	= "SSTRIPE"
$D66	= "RZ23L"
$D67	= "RX26"
$D68	= "RZ57I"
$D69	= "RZ31"
$D70	= "RZ58"
$D71	= "RWZ01"
$D72	= "RRD42"
$D73	= "CD_LOADER_1"
$D74	= "ESE25"
$D75	= "RFH31"
$D76	= "RFH72"
$D77	= "RF73"
$D78	= "RFH73"
$D79	= "RA72"
$D80	= "RAH72"
$D81	= "RF32"
$D82	= "RFH32"
$D83	= "RF31F"
$D84	= "RZ72"
$D85	= "RZ73"
$D86	= "RZ35"
$D87	= "RZ24L"
$D88	= "RZ25L"
$D89	= "RZ55L"
$D90	= "RZ56L"
$D91	= "RZ57L"
$D92	= "RA73"
$D93	= "RZ26"
$D94	= "RZ36"
$D95	= "RZ74"
$D96	= "ESE52"
$D97	= "ESE56"
$D98	= "ESE58"
$D99	= "RZ27"
$D100	= "RZ37"
$D101	= "RZ34L"
$D102	= "RZ35L"
$D103	= "RZ36L"
$D104	= "RZ38"
$D105	= "RZ75"
$D106	= "RZ59"
$D107	= "RZ13"
$D108	= "RZ14"
$D109	= "RZ15"
$D110	= "RZ16"
$D111	= "RZ17"
$D112	= "RZ18"
$D113	= "EZ51"
$D114	= "EZ52"
$D115	= "EZ53"
$D116	= "EZ54"
$D117	= "EZ58"
$D118	= "EF51"
$D119	= "EF52"
$D120	= "EF53"
$D121	= "EF54"
$D122	= "EF58"
$D123	= "RF36"
$D124	= "RF37"
$D125	= "RF74"
$D126	= "RF75"
$D127	= " "
$DEV_END  = 127
$ESC[0,8] = 27
$VT100	= 96
$VT52	= 64	! H-19
$TERM_TYPE	= F$GETDVI("SYS$OUTPUT","DEVTYPE")
$EGM	= "''ESC'(0"
$XGM	= "''ESC'(B"
$ERV	= "''ESC'[7m"
$XRV	= "''ESC'[0m"
$A	= -
 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
$IF	TERM_TYPE .GE. VT100 THEN $GOTO START
$EGM	= "''ESC'F"
$XGM	= "''ESC'G"
$ERV	= "''ESC'p"
$XRV	= "''ESC'q"
$IF 	TERM_TYPE .EQ. VT52  THEN $GOTO START
$A	= -
 "**********************************************************************"
$EGM	= ""
$XGM	= ""
$ERV	= ""
$XRV	= ""
$START:
$LOOP   = 0
$IF     P1 .EQS. "ALL" THEN LOOP = 1
$IF 	P1 .EQS. "" THEN P1 = F$PARSE("SYS$SYSTEM",,,"DEVICE")
$GET_NAME:
$IF     LOOP .EQ. 1 THEN P1 = F$DEVICE(,"DISK",,)
$IF     P1 .EQS. "" THEN $EXIT
$IF     F$GETDVI(P1,"MNT") THEN $GOTO MOUNT_ED
$WRITE  SYS$OUTPUT "Device ''P1' not mounted"
$IF     LOOP .NE. 1 THEN $EXIT
$GOTO   GET_NAME
$MOUNT_ED:
$IF     .NOT. F$GETDVI(P1,"FOR") THEN $GOTO GET_DVI
$WRITE  SYS$OUTPUT "Device ''P1' mounted foreign"
$IF     LOOP .NE. 1 THEN $EXIT
$GOTO   GET_NAME
$GET_DVI:
$DC	= F$GETDVI(P1,"DEVTYPE")
$IF	DC .GE. DEV_END THEN $DC = DEV_END
$DT	= D'DC'
$DM	= F$GETDVI(P1,"DEVNAM")
$VM	= F$GETDVI(P1,"VOLNAM")
$ER	= F$GETDVI(P1,"ERRCNT")
$CY	= F$GETDVI(P1,"CYLINDERS")
$SC	= F$GETDVI(P1,"SECTORS")
$OP	= F$GETDVI(P1,"OPCNT")
$RF	= F$GETDVI(P1,"REFCNT")
$MB	= F$GETDVI(P1,"MAXBLOCK")
$FB	= F$GETDVI(P1,"FREEBLOCKS")
$TR	= F$GETDVI(P1,"TRACKS")
$HDR	= " !AS !AS     !AS  !SL Megabytes  !SL Kbytes"
$CTL	= "!7SL Blocks used  !3SL%!/!7SL Blocks free  !3SL%!/!7SL TOTAL BLOCKS"
$CTL2	= "!7SL Cylinders     !4SL Tracks per cylinder    !4SL Sectors per track"
$CTL3	= "!7SL Operations    !4SL Current references     !4SL Errors"
$KB	= (MB * 512) / 1000
$MEG	= (MB * 512) / 1000000
$WRITE  SYS$OUTPUT ""
$LINE	= F$FAO(HDR,DM,VM,DT,MEG,KB)
$WRITE  SYS$OUTPUT LINE
$WRITE  SYS$OUTPUT ""
$UB	= MB - FB
$BFREE	= (FB * 100) / MB
$BUSED	= 100 - BFREE
$LINE	= F$FAO(CTL,UB,BUSED,FB,BFREE,MB)
$WRITE 	SYS$OUTPUT LINE
$WRITE  SYS$OUTPUT ""
$WRITE  SYS$OUTPUT "			   ''ERV' ''DM'  ''VM'  ''DT' usage ''XRV'"
$WRITE	SYS$OUTPUT -
"          1....10.....20.....30.....40.....50.....60.....70.....80.....90....100"
$B	=    	   "   "
$C	= UB / (MB / 70)
$IF	C .GT. 70 THEN C = 70
$C2	= 70 - C
$GRA	= "!3SL% Used ''EGM'!''C'AS!''C2'AS''XGM'"
$LINE	= F$FAO(GRA,BUSED,A,B)
$WRITE  SYS$OUTPUT LINE
$GRA	= "!3SL% Free ''EGM'!''C2'AS!''C'AS''XGM'"
$LINE	= F$FAO(GRA,BFREE,A,B)
$WRITE  SYS$OUTPUT LINE
$WRITE  SYS$OUTPUT ""
$LINE	= F$FAO(CTL2,CY,TR,SC)
$WRITE  SYS$OUTPUT LINE
$LINE	= F$FAO(CTL3,OP,RF,ER)
$WRITE 	SYS$OUTPUT LINE
$WRITE  SYS$OUTPUT ""
$IF     LOOP .EQ. 1 THEN $GOTO GET_NAME

Newsgroups: comp.os.vms