anchor.diff:  ensure_broken_file(Fn, BrokenFn) ->
       case filelib:is_regular(BrokenFn) of
   	true  -> ok;
  -	false -> file:copy(Fn, BrokenFn), broke_file(BrokenFn)
  -    end.
  -
  -
  -broke_file(BrokenFn) ->
  +	false -> file:copy(Fn, BrokenFn), break_file(BrokenFn)
  +    end.
  +
  +
  +break_file(BrokenFn) ->
       random:seed(now()),
  -    {ok, Fd} = file:open(BrokenFn, [write, binary, append]),
  +    {ok, Fd} = file:open(BrokenFn, [write, read, binary]),
       {ok, TotalSize} = file:position(Fd, eof),
       %% Modify 10 chunks in the file.
       write_bad_chunks(Fd, TotalSize, 10),
  
positive.code: enable_dht(AppConfig) ->
      [{dht, true}|AppConfig].
  
  
negative.code:     %% Len :: 1 .. 16#FFFF.
      Len  = random:uniform(16#FFFF),
      From = random:uniform(TotalSize - Len),
      ct:pal("write_bad_chunk of length ~p from ~p.", [Len, From]),
      file:pwrite(Fd, From, crypto:rand_bytes(Len)).
  
  
  