3
{ Program to demonstrate the FpDup2 function. }
11
Assign (f,'text.txt');
13
For i:=1 to 10 do writeln (F,'Line : ',i);
14
if fpdup2 (output,f)=-1 then
15
Writeln ('Dup2 Failed !');
16
writeln ('This is written to stdout.');
17
writeln (f,'This is written to the dup file, and flushed');
20
{ Remove file. Comment this if you want to check flushing.}
21
fpUnlink ('text.txt');
b'\\ No newline at end of file'