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

« back to all changes in this revision

Viewing changes to docs/unixex/ex62.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 Example62;
 
2
 
 
3
{ Program to demonstrate the ReadLink function. }
 
4
 
 
5
Uses BaseUnix,Unix;
 
6
 
 
7
Var F : Text;
 
8
    S : String;
 
9
 
 
10
begin
 
11
  Assign (F,'test.txt');
 
12
  Rewrite (F);
 
13
  Writeln (F,'This is written to test.txt');
 
14
  Close(f);
 
15
  { new.txt and test.txt are now the same file }
 
16
  if fpSymLink ('test.txt','new.txt')<>0 then
 
17
    writeln ('Error when symlinking !');
 
18
  S:=fpReadLink('new.txt');
 
19
  If S='' then
 
20
    Writeln ('Error reading link !')
 
21
  Else
 
22
    Writeln ('Link points to : ',S);
 
23
 { Now remove links }
 
24
 If fpUnlink ('new.txt')<>0 then
 
25
   Writeln ('Error when unlinking !');
 
26
 If fpUnlink ('test.txt')<>0 then
 
27
   Writeln ('Error when unlinking !');
 
28
end.