home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / blkos207.zip / IN.CMD < prev    next >
OS/2 REXX Batch file  |  1993-05-19  |  2KB  |  104 lines

  1. /*IN.CMD*/
  2. skip=' '   /* place capitalized drive letter(X:) here to exclude from search*/
  3. /*INFO.CMD*/
  4. /*SYSTEM INFO UTILITY*/
  5. /*copyright(c)1992,1993 C>BLACK,B.STONE,KUTEK*/
  6. /*all rights reserved*/
  7. /* usage: IN <drv,optional,no colon></> */
  8. /* specifying drv letter shows stats for that drv alone*/
  9. /* even floppy drvs*/
  10. /*  "/" parameter shows floppies also in long list of all drvs*/
  11.  
  12. call rxfuncadd sysloadfuncs,rexxutil,sysloadfuncs
  13. call sysloadfuncs
  14. 'cls'
  15. sfe=''
  16. nook=0
  17. qrt=syscurpos(5,0)
  18. say  'SYSTEM DRIVE STATS '
  19. parse upper arg sfe
  20. zcx=0
  21. if (sfe\='/')&(sfe\='') then do
  22. nook=1
  23. call single
  24. end
  25. else
  26. mp=sysdrivemap(,local)
  27. s=((length(mp))+1)/3
  28. if sfe='/' then do
  29. s=s+2
  30. l=s-1
  31. ll=1
  32.  end
  33. do i=1 to s
  34. if ll=1 then a.l='A:'
  35. if ll=1 then a.s='B:'
  36. if length(mp)\=0  then a.i=substr(mp,1,2)
  37. if length(mp)\=0 then mp=delstr(mp,1,3)
  38. if pos(a.i,skip)\=0 then iterate
  39. n.i= sysdriveinfo(a.i)
  40. end
  41. showw:
  42. zs=syscurpos()
  43. parse var zs r c
  44. say 'DRIVE'
  45. sa=syscurpos(r,20)
  46. say 'SPACE FREE'
  47. sa=syscurpos(r,40)
  48. say 'SPACE USED'
  49. sa=syscurpos(r,60)
  50. say 'VOLUME LABEL'
  51. sa=syscurpos(r+2,0)
  52. sun=0
  53. sum=0
  54. if nook=1 then s=1
  55. do i=1 to s
  56. parse var n.i c.1 c.2 c.3 c.4
  57. if (c.3\='')&(c.2\='') then c.3=c.3-c.2
  58. if c.2\=''&c.3\='' then do
  59. sun=sun+c.2
  60. sum=sum+c.3
  61. end
  62. if c.4='' then c.4='NO LABEL'
  63. if c.3=''  then  c.2='EXCLUDED DRIVE'
  64. if c.1='' then c.2='DRIVE 'a.i' NOT READY'
  65. c.1=a.i
  66. do u=1 to 4 
  67. sss=strip(c.u,'b')
  68. if datatype(sss,N)=1 then do
  69. xxx=sss
  70. call num
  71. sss=xxx
  72. end
  73. if pos('[',sss)=0 then say ''sss''
  74. else say sss
  75. sa=syscurpos(r+i+1,(u*20))
  76. end
  77. end
  78.  xxx=sun
  79. call num
  80. say
  81. if nook\=1 then say'DISPLAYED DRVS TOTAL FREE SPACE ' xxx ''
  82. xxx=sum
  83. call num
  84. if nook\=1 then say'DISPLAYED DRVS TOTAL USED SPACE ' xxx ''
  85.  
  86. exit
  87. num:
  88. a=length(xxx)
  89. if a<4 then do
  90.  return
  91. end
  92. else xxx=insert(',',xxx,a-3)
  93. do while pos(',',xxx)>4
  94. a=pos(',',xxx)
  95. xxx=insert(',',xxx,a-4)
  96. end
  97. return 
  98.  
  99. single:
  100. a.1=sfe':'
  101. n.1= sysdriveinfo(a.1)
  102. call showw
  103.  
  104.