procedure FileCopy(const FileFrom, FileTo: string);
var
  FromF,ToF: file;
  NumRead,NumWritten: Integer;
  Buffer: array[1..2048] of Byte;
begin
  AssignFile(FromF, FileFrom);
  Reset(FromF, 1);
  AssignFile(ToF, FileTo);
  Rewrite(ToF, 1);

  repeat
    BlockRead(FromF, Buffer, SizeOf(Buffer), NumRead);
    BlockWrite(ToF, Buffer, NumRead, NumWritten);
  until (NumRead = 0) or (NumWritten <> NumRead);

  CloseFile(FromF);
  CloseFile(ToF);
end;
posted on 2007-12-19 17:49  万一  阅读(2142)  评论(0编辑  收藏  举报