ex91.pp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. program Example30;
  2. { Program to demonstrate the FSStat function. }
  3. uses BaseUnix,Unix,UnixType;
  4. var s : string;
  5. fd : cint;
  6. info : tstatfs;
  7. begin
  8. writeln ('Info about current partition : ');
  9. s:='.';
  10. while s<>'q' do
  11. begin
  12. Fd:=fpOpen(S,O_RDOnly);
  13. if (fd>=0) then
  14. begin
  15. if fstatfs (fd,info)<>0 then
  16. begin
  17. writeln('Fstat failed. Errno : ',fpgeterrno);
  18. halt (1);
  19. end;
  20. FpClose(fd);
  21. writeln;
  22. writeln ('Result of fsstat on file ''',s,'''.');
  23. writeln ('fstype : ',info.fstype);
  24. writeln ('bsize : ',info.bsize);
  25. writeln ('bfree : ',info.bfree);
  26. writeln ('bavail : ',info.bavail);
  27. writeln ('files : ',info.files);
  28. writeln ('ffree : ',info.ffree);
  29. {$ifdef FreeBSD}
  30. writeln ('fsid : ',info.fsid[0]);
  31. {$else}
  32. writeln ('fsid : ',info.fsid[0]);
  33. writeln ('Namelen : ',info.namelen);
  34. {$endif}
  35. write ('Type name of file to do fsstat. (q quits) :');
  36. readln (s)
  37. end;
  38. end;
  39. end.