~ubuntu-branches/ubuntu/feisty/fpc/feisty

« back to all changes in this revision

Viewing changes to docs/unixex/ex91.pp

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2007-01-27 20:08:50 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070127200850-9mrptaqqjsx9nwa7
Tags: 2.0.4-5
* Fixed Build-Depends.
* Add myself to Uploaders in debian/control.
* Make sure that the sources are really patched before building them.
* Build unit 'libc' on powerpc too.

Show diffs side-by-side

added added

removed removed

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