anchor.diff:        { create helper }
         NewStream.SwapFileDirectory := ExtractFilePath(AbGetTempFile(FTempDir, False));
   
  -      {build new archive from existing archive}
  -      for i := 0 to pred(Count) do begin
  -        FCurrentItem := ItemList[i];
  -        CurItem      := TAbGzipItem(ItemList[i]);
  -        InGzHelp.SeekToItemData;
  -
  -        case CurItem.Action of
  -          aaNone, aaMove : begin
  -          {just copy the file to new stream}
  -            WorkingStream := TAbVirtualMemoryStream.Create;
  -            InGzHelp.SeekToItemData;
  -            InGzHelp.ExtractItemData(WorkingStream);
  -            WorkingStream.Position := 0;
  -            CurItem.SaveGzHeaderToStream(NewStream);
  -            OutGzHelp.WriteArchiveItem(WorkingStream);
  -          end;
  -
  -          aaDelete: {doing nothing omits file from new stream} ;
  -
  -          aaAdd, aaFreshen, aaReplace, aaStreamAdd: begin
  -            try
  -              if (CurItem.Action = aaStreamAdd) then begin
  -              { adding from a stream }
  -                CurItem.SaveGzHeaderToStream(NewStream);
  -                CurItem.UncompressedSize := InStream.Size;
  -                OutGzHelp.WriteArchiveItem(InStream);
  -              end
  -              else begin
  -              { it's coming from a file }
  -                UncompressedStream := TFileStream.Create(CurItem.DiskFileName,
  -                    fmOpenRead or fmShareDenyWrite );
  -                try
  -                  GetDir(0, SaveDir);
  -                  try {SaveDir}
  -                    if (BaseDirectory <> '') then
  -                      ChDir(BaseDirectory);
  -
  -                    {Now get the file's attributes}
  -                    CurItem.ExternalFileAttributes := AbFileGetAttr(CurItem.DiskFileName);
  -
  -                    CurItem.UncompressedSize := UncompressedStream.Size;
  -                  finally {SaveDir}
  -                    ChDir( SaveDir );
  -                  end; {SaveDir}
  -
  -{$WARN SYMBOL_DEPRECATED OFF}
  -                  DateTime := FileAge(CurItem.DiskFileName);
  -{$WARN SYMBOL_DEPRECATED ON}
  -                  CurItem.LastModFileTime := LongRec(DateTime).Lo;
  -                  CurItem.LastModFileDate := LongRec(DateTime).Hi;
  -
  +      { save the Tar data }
  +      if IsGzippedTar and TarAutoHandle then begin
  +        SwapToTar;
  +        inherited SaveArchive;
  +        if FGZItem.Count = 0 then begin
  +          CurItem := TAbGzipItem.Create;
  +          FGZItem.Add(CurItem);
  +        end;
  +        CurItem := FGZItem[0] as TAbGzipItem;
  +        CurItem.Action := aaNone;
  +        CurItem.LastModTimeAsDateTime := Now;
  +        CurItem.SaveGzHeaderToStream(NewStream);
  +        FTarStream.Position := 0;
  +        OutGzHelp.WriteArchiveItem(FTarStream);
  +        CurItem.CRC32 := OutGzHelp.CRC;
  +        CurItem.UncompressedSize := OutGzHelp.FileSize;
  +        OutGzHelp.WriteArchiveTail;
  +      end
  +      else begin
  +        SwapToGzip;
  +
  +        {build new archive from existing archive}
  +        for i := 0 to pred(Count) do begin
  +          FCurrentItem := ItemList[i];
  +          CurItem      := TAbGzipItem(ItemList[i]);
  +          InGzHelp.SeekToItemData;
  +
  +          case CurItem.Action of
  +            aaNone, aaMove : begin
  +            {just copy the file to new stream}
  +              CurItem.SaveGzHeaderToStream(NewStream);
  +              InGzHelp.SeekToItemData;
  +              NewStream.CopyFrom(FGZStream, FGZStream.Size - FGZStream.Position);
  +            end;
  +
  +            aaDelete: {doing nothing omits file from new stream} ;
  +
  +            aaAdd, aaFreshen, aaReplace, aaStreamAdd: begin
  +              try
  +                if (CurItem.Action = aaStreamAdd) then begin
  +                { adding from a stream }
                     CurItem.SaveGzHeaderToStream(NewStream);
  -                  OutGzHelp.WriteArchiveItem(UncompressedStream);
  -
  -                finally {UncompressedStream}
  -                  UncompressedStream.Free;
  -                end; {UncompressedStream}
  -
  +                  CurItem.UncompressedSize := InStream.Size;
  +                  OutGzHelp.WriteArchiveItem(InStream);
  +                  OutGzHelp.WriteArchiveTail;
  +                end
  +                else begin
  +                { it's coming from a file }
  +                  UncompressedStream := TFileStream.Create(CurItem.DiskFileName,
  +                      fmOpenRead or fmShareDenyWrite );
  +                  try
  +                    GetDir(0, SaveDir);
  +                    try {SaveDir}
  +                      if (BaseDirectory <> '') then
  +                        ChDir(BaseDirectory);
  +
  +                      {Now get the file's attributes}
  +                      CurItem.ExternalFileAttributes := AbFileGetAttr(CurItem.DiskFileName);
  +
  +                      CurItem.UncompressedSize := UncompressedStream.Size;
  +                    finally {SaveDir}
  +                      ChDir( SaveDir );
  +                    end; {SaveDir}
  +
  +                    {$WARN SYMBOL_DEPRECATED OFF}
  +                    DateTime := FileAge(CurItem.DiskFileName);
  +                    {$WARN SYMBOL_DEPRECATED ON}
  +                    CurItem.LastModFileTime := LongRec(DateTime).Lo;
  +                    CurItem.LastModFileDate := LongRec(DateTime).Hi;
  +
  +                    CurItem.SaveGzHeaderToStream(NewStream);
  +                    OutGzHelp.WriteArchiveItem(UncompressedStream);
  +                    OutGzHelp.WriteArchiveTail;
  +
  +                  finally {UncompressedStream}
  +                    UncompressedStream.Free;
  +                  end; {UncompressedStream}
  +                end;
  +              except
  +                ItemList[i].Action := aaDelete;
  +                DoProcessItemFailure(ItemList[i], ptAdd, ecFileOpenError, 0);
                 end;
  -            except
  -              ItemList[i].Action := aaDelete;
  -              DoProcessItemFailure(ItemList[i], ptAdd, ecFileOpenError, 0);
               end;
  -          end;
  -        end; {case}
  -      end; { for }
  +          end; {case}
  +        end; { for }
  +      end;
       finally
         InGzHelp.Free;
       end;
   
       {copy new stream to FStream}
  -    OutGzHelp.WriteArchiveTail;
  +    SwapToGzip;
       NewStream.Position := 0;
       if (FStream is TMemoryStream) then
         TMemoryStream(FStream).LoadFromStream(NewStream)
       else begin
         { need new stream to write }
         FreeAndNil(FStream);
  +      FGZStream := nil;
         FStream := TFileStream.Create(FArchiveName, fmOpenWrite or fmShareDenyWrite);
  -      try
  -        FStream.CopyFrom(NewStream, NewStream.Size);
  -        FGZStream := FStream;
  -      except
  -        raise EAbException.Create('Unable to create new Spanned stream');
  -      end;
  +      FGZStream := FStream;
  +      FStream.CopyFrom(NewStream, NewStream.Size);
       end;
   
       {update Items list}
  
positive.code:     FTarStream : TStream;        { stream for possible contained Tar }
      FTarList   : TAbArchiveList; { items in possible contained Tar }
      FTarAutoHandle: Boolean;
      FTarLoaded : Boolean;
      FState     : TAbGzipArchiveState;
      FIsGzippedTar : Boolean;
  
  
negative.code: 
  procedure TAbGzipArchive.LoadArchive;
  var
    GzHelp : TAbGzipStreamHelper;
    Item   : TAbGzipItem;
    Abort  : Boolean;
  begin
    SwapToGzip;
    if FGzStream.Size > 0 then begin
      GzHelp := TAbGzipStreamHelper.Create(FGzStream);
      try
        if GzHelp.FindFirstItem then begin
          Item := TAbGzipItem.Create;
          Item.LoadGzHeaderFromStream(FGzStream);
          FGzStream.Seek(-SizeOf(TAbGzTailRec), soFromEnd);
          GZHelp.ReadTail;
          Item.CRC32 := GZHelp.TailCRC;
          Item.UncompressedSize := GZHelp.TailSize;
  
          Item.Action := aaNone;
          FGZItem.Add(Item);
  
          if IsGzippedTar and TarAutoHandle then begin
            { extract Tar and set stream up }
            GzHelp.SeekToItemData;
            GzHelp.ExtractItemData(FTarStream);
            SwapToTar;
            inherited LoadArchive;
          end;
        end;
  
        DoArchiveProgress(100, Abort);
  