~ubuntu-branches/debian/lenny/fpc/lenny

« back to all changes in this revision

Viewing changes to docs/linuxex/ex22.pp

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-05-17 17:12:11 UTC
  • mfrom: (3.1.9 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080517171211-9qi33xhd9evfa0kg
Tags: 2.2.0-dfsg1-9
[ Torsten Werner ]
* Add Mazen Neifer to Uploaders field.

[ Mazen Neifer ]
* Moved FPC sources into a version dependent directory from /usr/share/fpcsrc
  to /usr/share/fpcsrc/${FPCVERSION}. This allow installing more than on FPC
  release.
* Fixed far call issue in compiler preventing building huge binearies.
  (closes: #477743)
* Updated building dependencies, recomennded and suggested packages.
* Moved fppkg to fp-utils as it is just a helper tool and is not required by
  compiler.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Program Example22;
2
 
 
3
 
{ Program to demonstrate the SymLink and UnLink functions. }
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
 
  { Removing test.txt still leaves new.txt
19
 
    Pointing now to a non-existent file ! }
20
 
  If fpUnlink ('test.txt')<>0 then
21
 
    Writeln ('Error when unlinking !');
22
 
  Assign (f,'new.txt');
23
 
  { This should fail, since the symbolic link
24
 
    points to a non-existent file! }
25
 
  {$i-}
26
 
  Reset (F);
27
 
  {$i+}
28
 
  If IOResult=0 then
29
 
    Writeln ('This shouldn''t happen'); 
30
 
 { Now remove new.txt also }
31
 
 If fpUnlink ('new.txt')<>0 then
32
 
   Writeln ('Error when unlinking !');
33
 
end.