3
{ Program to demonstrate the SymLink and UnLink functions. }
11
Assign (F,'test.txt');
13
Writeln (F,'This is written to test.txt');
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 !');
23
{ This should fail, since the symbolic link
24
points to a non-existent file! }
29
Writeln ('This shouldn''t happen');
30
{ Now remove new.txt also }
31
If fpUnlink ('new.txt')<>0 then
32
Writeln ('Error when unlinking !');