3
{ This program demonstrates the FileCreate function }
10
F:=FileCreate ('test.dat');
14
FileWrite(F,I,SizeOf(i));
16
F:=FileOpen ('test.dat',fmOpenRead);
19
FileRead (F,J,SizeOF(J));
21
Writeln ('Mismatch at file position ',I)
23
FileSeek(F,0,fsFromBeginning);
26
FileSeek(F,Random(100)*4,fsFromBeginning);
27
FileRead (F,J,SizeOf(J));
28
Writeln ('Random read : ',j);
31
F:=FileOpen('test.dat',fmOpenWrite);
32
I:=50*SizeOf(Longint);
33
If FileTruncate(F,I) then
34
Writeln('SuccessFully truncated file to ',I,' bytes.');
b'\\ No newline at end of file'