mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-18 21:19:33 +02:00
23 lines
412 B
ObjectPascal
23 lines
412 B
ObjectPascal
Program Example71;
|
|
|
|
{ Program to demonstrate the Truncate function. }
|
|
|
|
Var F : File of longint;
|
|
I,L : Longint;
|
|
|
|
begin
|
|
Assign (F,'test.dat');
|
|
Rewrite (F);
|
|
For I:=1 to 10 Do
|
|
Write (F,I);
|
|
Writeln ('Filesize before Truncate : ',FileSize(F));
|
|
Close (f);
|
|
Reset (F);
|
|
Repeat
|
|
Read (F,I);
|
|
Until i=5;
|
|
Truncate (F);
|
|
Writeln ('Filesize after Truncate : ',Filesize(F));
|
|
Close (f);
|
|
end.
|