anchor.diff:      io_lib:format("Error in dialyzing apps: ~s", [Error]);
   format_error({dialyzer_warnings, Warnings}) ->
       io_lib:format("Warnings occured running dialyzer: ~b", [Warnings]);
  +format_error({output_file_error, File, Error}) ->
  +    Error1 = file:format_error(Error),
  +    io_lib:format("Failed to write to ~s: ~s", [File, Error1]);
   format_error(Reason) ->
       io_lib:format("~p", [Reason]).
   
  
positive.code:     Apps = rebar_state:project_apps(State),
      get_plt_files(BasePltApps, Apps).
  
  update_base_plt(State, BasePlt, BaseFiles) ->
      ?INFO("Updating base plt...", []),
      case read_plt(State, BasePlt) of
          {ok, OldBaseFiles} ->
              check_plt(State, BasePlt, OldBaseFiles, BaseFiles);
          {error, no_such_file} ->
              _ = filelib:ensure_dir(BasePlt),
              build_plt(State, BasePlt, BaseFiles)
      end.
  
  build_plt(State, Plt, Files) ->
      ?INFO("Adding ~b files to ~p...", [length(Files), Plt]),
      GetWarnings = rebar_state:get(State, dialyzer_plt_warnings, false),
      Opts = [{analysis_type, plt_build},
              {get_warnings, GetWarnings},
              {output_plt, Plt},
              {files, Files}],
      run_dialyzer(State, Opts).
  
  succ_typings(State, Plt) ->
      {Args, _} = rebar_state:command_parsed_args(State),
      case proplists:get_value(succ_typings, Args) of
          false ->
              {0, State};
          _ ->
              Apps = rebar_state:project_apps(State),
              succ_typings(State, Plt, Apps)
      end.
  
  succ_typings(State, Plt, Apps) ->
      ?INFO("Doing success typing analysis...", []),
      {Files, Warnings} = apps_to_files(Apps),
      Warnings2 = format_warnings(Warnings),
      ?INFO("Analyzing ~b files with ~p...", [length(Files), Plt]),
      Opts = [{analysis_type, succ_typings},
              {get_warnings, true},
              {from, byte_code},
              {files, Files},
              {init_plt, Plt}],
      {Warnings3, State2} = run_dialyzer(State, Opts),
      {Warnings2 + Warnings3, State2}.
  
  apps_to_files(Apps) ->
  
negative.code:     {_, Files, Warnings} = app_name_to_info(AppName),
      {Files, Warnings}.
  
  run_dialyzer(State, Opts, Output) ->
      %% dialyzer may return callgraph warnings when get_warnings is false
      case proplists:get_bool(get_warnings, Opts) of
          true ->
  