anchor.diff:  % directory should be in ../ebin
   
   reload_with_options(Module, MyOptions) ->
  -    Src = get_file_for_module(Module),
  +    {Src, Options} = get_src_and_flags_for_module(Module),
       %ct:pal("~p", [file:get_cwd()]),
  -    Options = get_compile_flags_for_module(Module),
       %ct:pal("~p", [Options]),
       {ok, CurCWD} = file:get_cwd(),
       ok = fix_cwd_scalaris(),
  
positive.code: % misc. helper functions
  %
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  -spec get_file_for_module(module()) -> string().
  get_file_for_module(Module) ->
      % we have to be in $SCALARIS/ebin to find the beam file
      {ok, CurCWD} = file:get_cwd(),
      ok = fix_cwd_ebin(),
      Res = beam_lib:chunks(Module, [compile_info]),
      ok = file:set_cwd(CurCWD),
      case Res of
          {ok, {Module, [{compile_info, Options}]}} ->
              {source, Filename} = lists:keyfind(source, 1, Options),
              Filename;
          X ->
              ct:pal("~w ~p", [Module, X]),
              ct:pal("~p", [file:get_cwd()]),
  
negative.code:             ct:fail(unknown_module)
      end.
  
  % @doc set cwd to $SCALARIS/RelPath
  -spec fix_cwd(RelPath::string()) -> ok | {error, Reason::file:posix()}.
  fix_cwd(RelPath) ->
      case file:get_cwd() of
          {ok, CurCWD} ->
              case string:rstr(CurCWD, "/" ++ RelPath) =/= (length(CurCWD) - 4 + 1) of
                  true -> file:set_cwd("../" ++ RelPath);
                  _    -> ok
              end;
          Error -> Error
  