anchor.diff:  %%                     {stop, Reason}
   %% @doc Initiates the server.
   init(_Args) ->
  -    {ok, #state{config=ensure_config()}}.
  +    case ensure_config() of
  +        {ok, Config} ->
  +            {ok, #state{config=Config}};
  +        {error, Reason} ->
  +            ?ERROR("~s~n", [Reason]),
  +            {stop, config_file_error}
  +    end.
   
   
   %% @spec handle_call(Request, From, State) -> {reply, Reply, State} |
  
positive.code: 
  
  write_config(Key, Value) ->
      Config = [{Key,Value}, {modify_date, erlang:localtime()}
                  | proplists:delete(modify_date, proplists:delete(Key,ensure_config()))],
      write_config(Config).
  
  
  write_config(Config) ->
      {ok, Dev} = file:open(config_file(), [write]),
      ok = file:write(Dev, <<
              "% THIS FILE IS AUTOMATICALLY GENERATED, DO NOT CHANGE WHILE ZOTONIC IS RUNNING.",10,
              "%", 10,
              "% You can change these options when Zotonic is not running.",10,
              "% Delete this file to reset Zotonic to its defaults (when Zotonic is not running).",10,
              "% Consult the config.in file for available options and their defaults.",10,
              10>>),
      Data = io_lib:format("~p.~n", [Config]),
      ok = file:write(Dev, iolist_to_binary(Data)),
      ok = file:close(Dev).
      
  
  config_file() ->
  
negative.code: %% @doc Dirty write of config key, updates the config file on disk
  %% when the value is changed
  set_dirty(Key, Value) ->
      case ensure_config() of
          {ok, Config} ->
              case proplists:get_value(Key, Config) of
                  Value -> ok;
                  _ -> 
                      write_config(Key, Value),
                      ok
              end;
          Error ->
              Error
      end.
  
  
  