Hello Everybody,
I want to decompress a compressed file which contains some file. I can extract the first compressed file from archive, but the second one is empty yet.
Extract from my code:
for i := 1 to c do
begin
{ read filename }
s := '';
infile.Read(l, 4);
j := 1;
while j <= l do
begin
Seged := #0;
infile.Read(Seged, 1);
s := s + Seged;
Inc(j);
end;
{ read original filesize }
infile.Read(l, 4);
//Compressed filesize.
infile.Read(k, 4);
k := k + infile.Position;
{ decompress the files and store it }
s := dest + AnsiToUTF8(s); //include the path
outfile := TFileStream.Create(s,fmCreate + fmopenwrite);
outfile.Position:= 0;
SegedBuffer := 0;
while outfile.size < l do
begin
SegedBuffer :=decompr.read(buffer, 4096);
outfile.WriteBuffer(buffer, SegedBuffer);
end;
infile.Position:=k;
outfile.Free;
end;
What is wrong? (under Windows)
THX.