例子: 将buffer添加到文件最后
var
fid: Integer;
begin
if not fileexists('filename.dat') then
fid := filecreate('filename.dat')
else fid := fileopen('filename.dat', fmOpenWrite);
if fid >= 0 then
begin
fileseek(fid, 0, 2)
// 移到文件末尾
filewrite(fid, buffer[1], length(buffer));
fileclose(fid);
end;
end;