anchor.diff:  -export([start/1,stop/1,get/2,put/3,list/1,list_bucket/2,delete/2]).
   -include_lib("eunit/include/eunit.hrl").
   % @type state() = term().
  --record(state, {dir}).
  +-record(state, {dir, fakeSuffix}).
   
   %% @spec start(Partition :: integer()) ->
   %%          {ok, state()} | {{error, Reason :: term()}, state()}
  -%% @doc Start this backend.  'riak_fs_backend_root' must be
  -%%      set in Riak's application environment.  It must be set to
  -%%      a string representing the base directory where this backend
  -%%      should store its files.
  +%% @doc Start this backend.  'riak_fs_backend_root' must be set in
  +%%      Riak's application environment.  It must be set to a string
  +%%      representing the base directory where this backend should
  +%%      store its files. 'riak_fs_backend_fake_suffix' maybe set in
  +%%      Riak's application environment for enamble atomic write to fs.
   start(Partition) ->
       PartitionName = integer_to_list(Partition),
       ConfigRoot = riak:get_app_env(riak_fs_backend_root),
  
positive.code:         true -> file:read_file(File)
      end.
  
  %% @spec put(state(), BKey :: riak_object:bkey(), Val :: binary()) ->
  %%         ok | {error, Reason :: term()}
  %% @doc Store Val under Bkey
  put(State,BKey,Val) ->       
      File = location(State,BKey),
      case filelib:ensure_dir(File) of
          ok -> file:write_file(File,Val);
          X -> X
      end.
  
  
negative.code:             riak:stop("riak_fs_backend_root unset, failing.");
          true -> ok
      end,
      FakeSuffix = riak:get_app_env(riak_fs_backend_fake_suffix),
      Dir = filename:join([ConfigRoot,PartitionName]),
      {filelib:ensure_dir(Dir), #state{dir=Dir,
                                       fakeSuffix=FakeSuffix}}.
  
  %% @spec stop(state()) -> ok | {error, Reason :: term()}
  stop(_State) -> ok.
  