anchor.diff:  compile(Name, Dir) ->
       Module = get_code(build_module(Name)),
       Path = filename:join([Dir, get_module_beam_name(Name)]),
  -
  -    Device = case file:open(Path, [binary, write]) of
  -        {ok, Return} -> Return;
  -        {error, _Reason} = Error -> throw(Error)
  -    end,
  -
  -    file:write(Device, Module).
  +    bin_to_file(Module, Path).
   
   build_module(Name) ->
       {Publics, Ast, Attrs} = tree_to_ast(file, Name),
   
       [{attribute, 1, module, get_module_name(Name)}|
  -        [{attribute, 1, export, Publics}|Attrs]] ++ Ast.
  +        [{attribute, 2, export, Publics}|Attrs]] ++ Ast.
   
   print_module(Name) ->
       io:format("~p~n", [build_module(Name)]).
  
positive.code:         Errors1 -> throw(Errors1)
      end.
  
  % to erlang functions
  
  get_erlang(file, String) ->
  
negative.code:     end,
  
      binary_to_list(Content).
  
  string_to_file(String, Path) ->
      to_file(String, Path, [write]).
  
  bin_to_file(Bin, Path) ->
      to_file(Bin, Path, [binary, write]).
  
  to_file(Data, Path, Mode) ->
      Device = case file:open(Path, Mode) of
          {ok, Return} -> Return;
          {error, _Reason} = Error -> throw(Error)
      end,
  
      file:write(Device, Data).
  
  get_module_name(String) ->
      File = filename:basename(String),
  