home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Graphics / Graphics.zip / os2apipm.zip / APIEXAM / FLSYS.ADB < prev    next >
Text File  |  1995-11-04  |  1KB  |  31 lines

  1. --  driver information  DosQueryFSInfo API OS/2
  2. with Ada.text_io; use Ada.text_io;
  3. with builtin; use builtin;
  4. with os2; use os2;
  5. with os2.fm; use os2.fm;
  6. procedure flsys is
  7. Level:ULONG:= 1 ;                 --  1=file  2=vol
  8. drive:ULONG;         --  driver's number
  9.                                  -- 0=work     1=Ç  2=é ...
  10. buffer: aliased FSALLOCATE ;    --  Os2-fm
  11. -- pbuffer:PFSALLOCATE:=buffer'access;
  12. pbuffer:PVOID :=buffer'address;
  13. size  : ULONG:=buffer'size/8;                --  buffer's size
  14. rc    : APIRET;
  15. i     : integer;
  16. package io is new integer_io(integer);
  17. begin
  18. put("Input drive number "); io.get(i); drive:=ulong(i);
  19.  
  20. rc:=DosQueryFSInfo(drive, Level,pbuffer, size);
  21.  
  22. put_edit("DosQFSInfo error=",integer(rc),4);
  23. if rc>0 then goto fin; end if;
  24. new_line; put_edit("File system ID =    ",integer( buffer.idFileSystem));
  25. new_line; put_edit("Number of sectors = ",integer( buffer.cSectorUnit));
  26. new_line; put_edit("Allocation units =  ",integer( buffer.cUnit));
  27. new_line; put_edit("Availavle units =   ",integer( buffer.cUnitAvail));
  28. new_line; put_edit("Bytes per sector =  ",integer( buffer.cbSector));
  29. <<fin>> null;
  30. end flsys;
  31.