~ubuntu-branches/ubuntu/dapper/fpc/dapper

« back to all changes in this revision

Viewing changes to docs/bunixex/ex28.pp

  • Committer: Bazaar Package Importer
  • Author(s): Carlos Laviola
  • Date: 2005-05-30 11:59:10 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20050530115910-x5pbzm4qqta4i94h
Tags: 2.0.0-2
debian/fp-compiler.postinst.in: forgot to reapply the patch that
correctly creates the slave link to pc(1).  (Closes: #310907)

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'