procedure TForm1.FileCopy(const FromFile, ToFile: string);
var
  FromF, ToF: file;
  NumRead, NumWritten: dWord;
  Buf: array[1..2049] of Char;
begin
  AssignFile(FromF, FromFile);
  Reset(FromF, 1);
  AssignFile(ToF, ToFile);
  Rewrite(ToF, 1);
  repeat
    BlockRead(FromF, Buf, SizeOf(Buf),NumRead);
    BlockWrite(ToF, Buf, NumRead, NumWritten);
  until (NumRead = 0) or (NumWritten <> NumRead);
  CloseFile(FromF);
  CloseFile(ToF);
end;