anchor.diff:      end.
   
   set_deleteme_flag(Filename) ->
  -    file:write_file(Filename ++ ".deleted", "").
  +    file:write_file(Filename ++ ?DELETEME_FLAG, "").
   
   clear_deleteme_flag(Filename) ->
  -    file:delete(Filename ++ ".deleted").
  +    file:delete(Filename ++ ?DELETEME_FLAG).
  +
  +has_deleteme_flag(Filename) ->
  +    filelib:is_file(Filename ++ ?DELETEME_FLAG).
   
   %% Figure out which files to merge. Take the average of file sizes,
   %% return anything smaller than the average for merging.
  
positive.code:     {ok, RolloverSize} = application:get_env(merge_index, buffer_rollover_size),
      case mi_buffer:filesize(CurrentBuffer) > RolloverSize of
          true ->
              #state { root=Root, next_id=NextID } = NewState,
              
              %% Close the buffer filehandle. Needs to be done in the owner process.
              mi_buffer:close_filehandle(CurrentBuffer),
              Pid = self(),
              
              spawn_link(fun() ->
                  %% Calculate the segment filename, open the segment, and convert.
                  SNum  = get_id_number(mi_buffer:filename(CurrentBuffer)),
                  SName = join(Root, "segment." ++ integer_to_list(SNum)),
                  set_deleteme_flag(SName),
                  SegmentWO = mi_segment:open_write(SName),
                  mi_segment:from_buffer(CurrentBuffer, SegmentWO),
                  gen_server:call(Pid, {buffer_to_segment, CurrentBuffer, SegmentWO}, infinity)
              end),
              
              %% Create a new empty buffer...
              BName = join(NewState, "buffer." ++ integer_to_list(NextID)),
  
negative.code:     buffers,
      next_id,
      scheduled_compaction,
      is_compacting,
      buffer_converter
  }).
  
  -define(RESULTVEC_SIZE, 1000).
  -define(DELETEME_FLAG, ".deleted").
  
  init([Root]) ->
      %% Load from disk...
  