看一下这个例子,来自 Hubdog的葵花宝典
合并两个二进制文件。
Var
f1, f2 : File;
xfer : Word;
buf : PChar;
Begin
AssignFile(f1, name1);
Reset(f1);
Seek(f1, Filesize(f1));
AssignFile(f2, name2);
Reset(f2);
GetMem(buf, 65000);
Repeat
BlockRead(f1, buf^, 65000, xfer);
BlockWrite(f2, buf^, xfer);
Until xfer < 65000;
CloseFile(f1);
CloseFile(f2);
End;