#1 2023-10-28 07:21:06

lfyey121
Member
From: china
Registered: 2022-08-25
Posts: 58

Failed to decompress the compressed file using GzFile. Procedure

I used the following method to extract it,Error on line 880 of mormot.lib.z:Error -3[data error] during TsynZipDecompressor.write process(avail in =131070 out=131072)

function TmainForm.GUnZipFile(aSrcFile, aDestFile: TFileName; aIsFile: Boolean
  ): boolean;
var
  gz: TSynZipDeCompressor;
  s, d: TStream;
  vfn:TFileName;
begin
  try
    s := TFileStreamEx.Create(aSrcFile, fmOpenReadDenyNone);
    try
      if aIsFile then
        vfn:=aDestFile
      else
        vfn:=aDestFile+extractFileName(aSrcFile);
      d := TFileStreamEx.Create(vfn, fmCreate);
      try
        gz := TSynZipDeCompressor.Create(d,szcFzip{, szcfGZ});
        try
          StreamCopyUntilEnd(s, gz);
          result := true;
        finally
          gz.Free;
        end;
      finally
        d.Free;
      end;
    finally
      s.Free;
    end;
  except
    result := false;
  end;
end;

Last edited by lfyey121 (2023-10-28 07:21:49)

Offline

#2 2023-10-28 07:25:39

lfyey121
Member
From: china
Registered: 2022-08-25
Posts: 58

Re: Failed to decompress the compressed file using GzFile. Procedure

When TSynZipDecompressor. Create (d, szcfRaw), the error is: (avail in = 131071 out = 131072)

Offline

Board footer

Powered by FluxBB