anchor.diff:  
   
   
  +
  +% Delete a channel.  To be called from an external shell.  This will
  +% remove all traces of a channel in Mnesia from all nodes.  Note - will
  +% not remove any archive files from disk.
  +
  +delete_channel(Channel) ->
  +  Transaction = fun() ->
  +    lists:foreach(fun(I) ->
  +      case mnesia:read({ rows, { last, Channel, I } }) of
  +        [ { _, _, L } ] ->
  +          [ { _, _, F } ] = mnesia:read({ rows, { first, Channel, I } }),
  +
  +          lists:foreach(fun(N) ->
  +            mnesia:delete({ rows, { I, Channel, N } })
  +          end, lists:seq(F, L, 1)),
  +
  +          mnesia:delete({ rows, { created, Channel, I } }),
  +          mnesia:delete({ rows, { first, Channel, I } }),
  +          mnesia:delete({ rows, { last, Channel, I } })
  +          ;
  +        [] ->
  +          no_such_channel
  +      end,
  +
  +      case mnesia:read({ rows, { updated, I } }) of
  +        [ { _, _, UpdateList } ] ->
  +          mnesia:write({ rows, { updated, I }, lists:keydelete(Channel, 1, UpdateList) })
  +          ;
  +        [] ->
  +          ok
  +      end
  +    end, mnesia:table_info(rows, disc_copies)),
  +
  +    mnesia:delete({ rows, { users, Channel } }),
  +
  +    case mnesia:read({ rows, channels }) of
  +      [ { _, _, UpdateList } ] ->
  +        mnesia:write({ rows, channels, lists:keydelete(Channel, 1, UpdateList) }),
  +        ok
  +        ;
  +      [] ->
  +        ok
  +    end
  +  end,
  +
  +  case mnesia:transaction(Transaction) of
  +    { aborted, Reason } ->
  +      error_logger:warning_msg("Error: Delete channel failed: ~p~n", [Reason]),
  +      error
  +      ;
  +    { atomic, Rval } ->
  +      Rval
  +  end.
  +
  +
  +
   % Fetch a sorted list of all channels.
   
   get_channel_list() ->
  
positive.code: % atc872.erl
  %
  % Version: 0.4
  %
  % Server for the ATC872 online forum service.
  %
  
negative.code: 
  
  -module(atc872).
  -export([ start/1, add_row/5, add_row/6, fetch_rows/4, search_rows/3, archiver/1, full_archive/1, get_channel_list/0, channel_renderer/1, delete_channel/1 ]).
  
  
  
  