anchor.diff:                   catch file:close(FH),
                    File = integer_to_list(Moment rem S0#slide.window),
                    {ok, FH2} = file:open(filename:join(Dir, File),
  -                                       [write, raw, binary, delayed_write]),
  +                                       file_write_options()),
                    S0#slide{readings_m = Moment,
                             readings_fh = FH2,
                             oldest = if Oldest == undefined ->
  
positive.code:     S0 = slide:fresh(10),
      ?assertEqual({0, {undefined, undefined, undefined, undefined}},
                   slide:nines(S0)),
      S1 = PushReadings(S0, [ {R, 1} || R <- lists:seq(1, 10) ]),
      ?assertEqual({10, {5, 10, 10, 10}}, slide:nines(S1, 9, 10)),
      S2 = PushReadings(S1, [ {R, 2} || R <- lists:seq(11, 20) ]),
      ?assertEqual({20, {10, 19, 20, 20}}, slide:nines(S2, 9, 10)),
      S3 = PushReadings(S2, [ {R, 3} || R <- lists:seq(21, 100) ]),
      ?assertEqual({100, {50, 95, 99, 100}}, slide:nines(S3, 9, 10)),
      ?assertEqual({90, {55, 96, 100, 100}}, slide:nines(S3, 11, 10)).
  
  not_most_recent_test() ->
      S0 = slide:fresh(10, 20),
      S1 = slide:update(S0, 3, 13),
      S2 = slide:update(S1, 5, 1),
      S3 = slide:update(S2, 7, 22),
      ?assertEqual({2, 8}, slide:sum(S2, 13, 13)),
      ?assertEqual({1, 3}, slide:sum(S3, 13, 13)),
      ?assertEqual({2, 10}, slide:sum(S3, 22, 22)).
  
  already_pruned_test() ->
      S0 = slide:fresh(10, 20),
      S1 = slide:update(S0, 3, 30),
      S2 = slide:update(S1, 5, 1),
      ?assertEqual(slide:sum(S1, 30, 30),
                   slide:sum(S2, 30, 30)).
  
  -endif. %TEST
  
negative.code:     S3 = slide:update(S2, 7, 5),
      ?assertEqual({3, 5.0}, % three points (two concurrent), avg = 5
                    slide:mean(S3, 9, 10)),
      S3b = idle_time_passing(S3, 6, 13),
      S4 = slide:update(S3b, 11, 14),
      ?assertEqual(23/11, % ignoring first reading, avg = 
                   element(2, slide:mean(S4, 14, 10))),
      S4b = idle_time_passing(S4, 15, 18),
      ?assertEqual(11/10, % shifted window
                   element(2, slide:mean(S4b, 18, 10))),
      S4c = idle_time_passing(S4b, 19, 21),
      S5 = slide:update(S4c, 13, 22),
      ?assertEqual(24/10, % shifted window
                   element(2, slide:mean(S5, 22, 10))).
      
  mean_and_nines_test() ->
      setup_eunit_proc_dict(),
      PushReadings = fun(S, Readings) ->
                             lists:foldl(
                               fun({R,T}, A) ->
  