meiner Meinung nach geht das mit Seek()...
guck mal in die Delphi-Hilfe.Da steht alles drinne
Delphi-Hilfe-Beispiel:
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var
f: file of Byte;
size: Longint;
S: string;
y: Integer;
begin
if OpenDialog1.Execute then
begin
AssignFile(f, OpenDialog1.FileName);
Reset(f);
try
size := FileSize(f);
S := 'File size in bytes: ' + IntToStr(size);
y := 10;
Canvas.TextOut(5, y, S);
y := y + Canvas.TextHeight(S) + 5;
S := 'Seeking halfway into file...';
Canvas.TextOut(5, y, S);
y := y + Canvas.TextHeight(S) + 5;
Seek(f, size div 2);
S := 'Position is now ' + IntToStr(FilePos(f));
Canvas.TextOut(5, y, S);
finally
CloseFile(f);
end;
end;
end;
MFg Alex