home *** CD-ROM | disk | FTP | other *** search
/ AMOS PD CD / amospdcd.iso / 451-475 / apd453 / info.amos / info.amosSourceCode
AMOS Source Code  |  1993-01-08  |  1KB  |  56 lines

  1. '***************************************** 
  2. '*               Info.AMOS               * 
  3. '*       ï¿½1992 by Volker Stepprath       * 
  4. '*  Shows informations about a DOS Disk  * 
  5. '***************************************** 
  6. '
  7. Do 
  8.   '
  9.   '**** Define drive ****
  10.   '
  11.   Input "Device.....: ";DEV$
  12.   If DEV$="" Then Edit 
  13.   If Not Exist(DEV$) Then Edit 
  14.   Dir$=DEV$
  15.   DEV$=Dir$
  16.   DEV$=DEV$+Chr$(0)
  17.   INFO$=Space$(40)+Chr$(0)
  18.   IN=Varptr(INFO$)
  19.   '
  20.   '**** Get lock ( ACCESS_READ ) ****
  21.   '
  22.   Dreg(1)=Varptr(DEV$)
  23.   Dreg(2)=-2
  24.   XLOCK=Doscall(-84)
  25.   '
  26.   '**** Get informatios **** 
  27.   '
  28.   Dreg(1)=XLOCK
  29.   Dreg(2)=IN
  30.   XINFO=Doscall(-114)
  31.   '
  32.   '**** Unlock ****
  33.   '
  34.   XUNLOCK=Doscall(-90)
  35.   '
  36.   '**** Show informations **** 
  37.   '
  38.   Print "Name.......: ";DEV$;Chr$(13)
  39.   Print "Errors.....:";Leek(IN)
  40.   Print "Drive......:";Leek(IN+4)
  41.   N=Leek(IN+8)
  42.   If N=80 Then N$="Read only"
  43.   If N=81 Then N$="Validating"
  44.   If N=82 Then N$="Read/Write"
  45.   Print "Status.....:";N;" ( "+N$+" )"
  46.   Print "Blocks.....:";Leek(IN+12)
  47.   Print "Blocks used:";Leek(IN+16)
  48.   Print "Bytes/Block:";Leek(IN+20)
  49.   Print "Disktype...: ";
  50.   For I=24 To 27 : Print Chr$(Peek(IN+I)); : Next I
  51.   Print : Print "Disknode...:";Leek(IN+28)
  52.   Print "Bytes free.:";Dfree
  53.   Print "Full.......:";Int(100-(100.0/856928.0)*Dfree);"%"
  54.   Print String$("-",39)
  55.   '
  56. Loop