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

« back to all changes in this revision

Viewing changes to docs/bunixex/ex28.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 example28;
2
 
 
3
 
{ Program to demonstrate the FStat function. }
4
 
 
5
 
uses BaseUnix;
6
 
 
7
 
var f : text;
8
 
    i : byte;
9
 
    info : stat;
10
 
 
11
 
begin
12
 
  { Make a file }
13
 
  assign (f,'test.fil');
14
 
  rewrite (f);
15
 
  for i:=1 to 10 do writeln (f,'Testline # ',i);
16
 
  close (f);
17
 
  { Do the call on made file. }
18
 
  if fpstat ('test.fil',info)<>0 then
19
 
     begin
20
 
       writeln('Fstat failed. Errno : ',fpgeterrno);
21
 
       halt (1);
22
 
     end;
23
 
  writeln;
24
 
  writeln ('Result of fstat on file ''test.fil''.');
25
 
  writeln ('Inode   : ',info.st_ino);
26
 
  writeln ('Mode    : ',info.st_mode);
27
 
  writeln ('nlink   : ',info.st_nlink);
28
 
  writeln ('uid     : ',info.st_uid);
29
 
  writeln ('gid     : ',info.st_gid);
30
 
  writeln ('rdev    : ',info.st_rdev);
31
 
  writeln ('Size    : ',info.st_size);
32
 
  writeln ('Blksize : ',info.st_blksize);
33
 
  writeln ('Blocks  : ',info.st_blocks);
34
 
  writeln ('atime   : ',info.st_atime);
35
 
  writeln ('mtime   : ',info.st_mtime);
36
 
  writeln ('ctime   : ',info.st_ctime);
37
 
  { Remove file }
38
 
  erase (f);
39
 
end.
 
 
b'\\ No newline at end of file'