anchor.diff:      FTarStream : TStream;        { stream for possible contained Tar }
       FTarList   : TAbArchiveList; { items in possible contained Tar }
       FTarAutoHandle: Boolean;
  -    FTarLoaded : Boolean;
       FState     : TAbGzipArchiveState;
       FIsGzippedTar : Boolean;
   
  
positive.code:       { 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;
  
                    CurItem.SaveGzHeaderToStream(NewStream);
                    OutGzHelp.WriteArchiveItem(UncompressedStream);
  
                  finally {UncompressedStream}
                    UncompressedStream.Free;
                  end; {UncompressedStream}
  
                end;
              except
                ItemList[i].Action := aaDelete;
                DoProcessItemFailure(ItemList[i], ptAdd, ecFileOpenError, 0);
              end;
            end;
          end; {case}
        end; { for }
      finally
        InGzHelp.Free;
      end;
  
      {copy new stream to FStream}
      OutGzHelp.WriteArchiveTail;
      NewStream.Position := 0;
      if (FStream is TMemoryStream) then
        TMemoryStream(FStream).LoadFromStream(NewStream)
      else begin
        { need new stream to write }
        FreeAndNil(FStream);
        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;
      end;
  
      {update Items list}
  
negative.code:         ItemList[i].Action := aaNone;
      end;
  
      if IsGzippedTar and TarAutoHandle then
        SwapToTar;
  
      DoArchiveSaveProgress( 100, Abort );                               {!!.04}
      DoArchiveProgress( 100, Abort );
    finally {NewStream}
      OutGzHelp.Free;
      NewStream.Free;
    end;
  