Yanghn Notes

BlogJava 首页 新随笔 联系 聚合 管理
  10 Posts :: 10 Stories :: 2 Comments :: 0 Trackbacks
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 2010-05-10 10:05 小海 阅读(126) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航: