var
log:TFileStream;
a,b,c :array of char;
begin
setLength(a,1024);
FillChar(a,1024,'A');
SetLength(b,2048);
FillChar(b,2048,'B');
SetLength(c,128);
FillChar(c,128,'C');
log :=TFileStream.Create('log.txt',fmCreate);
log.write(a,sizeof(a));//如此便可写入文件了,不需要太麻烦
log.Write(b,sizeof(b));
log.Write(c,sizeof(c));
a :=nil;
b :=nil;
c :=nil;
end
//读
var
log:TFileStream;
a,b,c :array of char;
begin
setLength(a,1024);
SetLength(b,2048);
SetLength(c,128);
log :=TFileStream.Create('log.txt',fmOpenRead);
log.Read(a,sizeof(a));
log.Read(b,sizeof(b));
log.Read(c,sizeof(c));
a :=nil;
b :=nil;
c :=nil;
end;