Hi,with the following code i write the content of an static array into a file:Code: Pascal [Select][+][-]var fs:TFileStream; stream: array[1..8,1..32000000] of byte; i:integer;... for i:=1 to 8 do begin fs:=TFileStream.create('d://stream_cpu.dat',fmCreate); try fs.write(stream[i],sizeOf(stream[i])); finally fs.free; end; end; Now i want to read it back from the file into the array, but i searched and nothing found how to do this. Please help me...Thank you.Torsten
with the following code i write the content of an static array into a file:Code: Pascal [Select][+][-]... for i:=1 to 8 do begin fs:=TFileStream.create('d://stream_cpu.dat',fmCreate); try fs.write(stream[i],sizeOf(stream[i])); finally fs.free; end; end;
It will make 8 files.
var fs: TFileStream; stream: array[1..8, 1..32000000] of byte; i: integer;...for i := 1 to 8 dobegin fs := TFileStream.Create('d:\mdf\projects\stream_cpu' + IntToStr(i) + '.dat', fmCreate); try fs.WriteBuffer(stream[i], SizeOf(stream[i])); finally fs.free; end;end;
var fs: TFileStream; stream: array[1..8, 1..32000000] of byte; i: integer;...for i := 1 to 8 dobegin fs := TFileStream.Create('d:\mdf\projects\stream_cpu' + IntToStr(i) + '.dat', fmOpenRead or fmShareDenyWrite); try fs.ReadBuffer(stream[i], SizeOf(stream[i])); finally fs.free; end;end;
const NumFiles = 8; MaxBytes = 32000000;var fs: TFileStream; stream: array[1..NumFiles, 1..MaxBytes] of byte; i: integer;...for i := 1 to NumFiles dobegin fs := TFileStream.Create('d:\mdf\projects\stream_cpu' + IntToStr(i) + '.dat', fmCreate); try fs.WriteBuffer(stream[i], MaxBytes); finally fs.free; end;end;
const NumFiles = 8; MaxBytes = 32000000;var fs: TFileStream; stream: array[1..NumFiles, 1..MaxBytes] of byte; i: integer;...for i := 1 to NumFiles dobegin fs := TFileStream.Create('d:\mdf\projects\stream_cpu' + IntToStr(i) + '.dat', fmOpenRead or fmShareDenyWrite); try fs.ReadBuffer(stream[i], MaxBytes); finally fs.free; end;end;