	program pos
	implicit integer(a-z)
	parameter maxdisks = 32

	parameter strsize  = 64
	parameter esc = char(27)
	character device*19
	character diskname(maxdisks)*64
	integer*4 dvl(maxdisks)
	integer*4 maxblks(maxdisks)
	integer*4 freeblks(maxdisks)

	istat=diskspace (maxdisks, n,
     &			   strsize, dvl, %ref(diskname),
     &			   maxblks, freeblks)
	if ( (istat .and. 1) .ne. 1) call lib$signal(%val(istat))

	
	print 50
d	totblks = 0
d	totfree = 0
	do i=1,n
	  call trnlnm(diskname(i)(:dvl(i)), device)
	  if (device(1:1) .eq. '_') device = device(2:)
c	  if (device(1:1) .eq. esc) device = device(4:)
	  print 100, device, diskname(i)(:34), maxblks(i), freeblks(i),
     &	    100.0 * freeblks(i) / maxblks(i)
d	  totblks = totblks + maxblks(i)
d	  totfree = totfree + freeblks(i)
	end do
d	print 100, ' ', 'Total  ', totblks, totfree, 100.0*totfree/totblks
	
	call exit

50	format('0Device', t21, 'Logical Name', t49, 'Max. Space',
     &		t62, 'Free Space', t76, '% Free')
100	format(1x,a19, a27, i11, i13, f10.2)
	end
