anchor.diff:      str_utils:format_bin("~s(~B)~s", [RootName, Counter, Ext]).
   
   
  -%%--------------------------------------------------------------------
  -%% @private
  -%% @doc
  -%% Adds attributes listed in list, to given map.
  -%% @end
  -%%--------------------------------------------------------------------
  --spec gather_attributes(map(), list(), #file_attr{}) -> map().
  -gather_attributes(Map, [], _Attr) ->
  -    Map;
  -gather_attributes(Map, [<<"mode">> | Rest], Attr = #file_attr{mode = Mode}) ->
  -    maps:put(<<"mode">>, <<"0", (integer_to_binary(Mode, 8))/binary>>, gather_attributes(Map, Rest, Attr));
  -gather_attributes(Map, [<<"size">> | Rest], Attr = #file_attr{size = Size}) ->
  -    maps:put(<<"size">>, Size, gather_attributes(Map, Rest, Attr));
  -gather_attributes(Map, [<<"atime">> | Rest], Attr = #file_attr{atime = ATime}) ->
  -    maps:put(<<"atime">>, ATime, gather_attributes(Map, Rest, Attr));
  -gather_attributes(Map, [<<"ctime">> | Rest], Attr = #file_attr{ctime = CTime}) ->
  -    maps:put(<<"ctime">>, CTime, gather_attributes(Map, Rest, Attr));
  -gather_attributes(Map, [<<"mtime">> | Rest], Attr = #file_attr{mtime = MTime}) ->
  -    maps:put(<<"mtime">>, MTime, gather_attributes(Map, Rest, Attr));
  -gather_attributes(Map, [<<"storage_group_id">> | Rest], Attr = #file_attr{gid = Gid}) ->
  -    maps:put(<<"storage_group_id">>, Gid, gather_attributes(Map, Rest, Attr));
  -gather_attributes(Map, [<<"storage_user_id">> | Rest], Attr = #file_attr{uid = Gid}) ->
  -    maps:put(<<"storage_user_id">>, Gid, gather_attributes(Map, Rest, Attr));
  -gather_attributes(Map, [<<"name">> | Rest], Attr = #file_attr{name = Name}) ->
  -    maps:put(<<"name">>, Name, gather_attributes(Map, Rest, Attr));
  -gather_attributes(Map, [<<"owner_id">> | Rest], Attr = #file_attr{owner_id = OwnerId}) ->
  -    maps:put(<<"owner_id">>, OwnerId, gather_attributes(Map, Rest, Attr));
  -gather_attributes(Map, [<<"shares">> | Rest], Attr = #file_attr{shares = Shares}) ->
  -    maps:put(<<"shares">>, Shares, gather_attributes(Map, Rest, Attr));
  -gather_attributes(Map, [<<"type">> | Rest], Attr = #file_attr{type = ?REGULAR_FILE_TYPE}) ->
  -    maps:put(<<"type">>, <<"reg">>, gather_attributes(Map, Rest, Attr));
  -gather_attributes(Map, [<<"type">> | Rest], Attr = #file_attr{type = ?DIRECTORY_TYPE}) ->
  -    maps:put(<<"type">>, <<"dir">>, gather_attributes(Map, Rest, Attr));
  -gather_attributes(Map, [<<"type">> | Rest], Attr = #file_attr{type = ?SYMLINK_TYPE}) ->
  -    maps:put(<<"type">>, <<"lnk">>, gather_attributes(Map, Rest, Attr));
  -gather_attributes(Map, [<<"file_id">> | Rest], Attr = #file_attr{guid = Guid}) ->
  +%% @private
  +-spec get_attr(binary(), #file_attr{}) -> term().
  +get_attr(<<"mode">>, #file_attr{mode = Mode}) ->
  +    <<"0", (integer_to_binary(Mode, 8))/binary>>;
  +get_attr(<<"name">>, #file_attr{name = Name}) -> Name;
  +get_attr(<<"size">>, #file_attr{size = Size}) -> Size;
  +get_attr(<<"atime">>, #file_attr{atime = ATime}) -> ATime;
  +get_attr(<<"ctime">>, #file_attr{ctime = CTime}) -> CTime;
  +get_attr(<<"mtime">>, #file_attr{mtime = MTime}) -> MTime;
  +get_attr(<<"owner_id">>, #file_attr{owner_id = OwnerId}) -> OwnerId;
  +get_attr(<<"type">>, #file_attr{type = ?REGULAR_FILE_TYPE}) -> <<"reg">>;
  +get_attr(<<"type">>, #file_attr{type = ?DIRECTORY_TYPE}) -> <<"dir">>;
  +get_attr(<<"type">>, #file_attr{type = ?SYMLINK_TYPE}) -> <<"lnk">>;
  +get_attr(<<"shares">>, #file_attr{shares = Shares}) -> Shares;
  +get_attr(<<"storage_user_id">>, #file_attr{uid = Uid}) -> Uid;
  +get_attr(<<"storage_group_id">>, #file_attr{gid = Gid}) -> Gid;
  +get_attr(<<"file_id">>, #file_attr{guid = Guid}) ->
       {ok, Id} = file_id:guid_to_objectid(Guid),
  -    maps:put(<<"file_id">>, Id, gather_attributes(Map, Rest, Attr)).
  +    Id.
  
positive.code:     end.
  
  
  %%--------------------------------------------------------------------
  %% @doc
  %% {@link op_logic_behaviour} callback update/1.
  
negative.code: 
  create(#op_req{auth = Auth, data = Data, gri = #gri{id = Guid, aspect = xattrs}}) ->
      [{Name, Value}] = maps:to_list(maps:get(<<"application/json">>, Data)),
      ?check(lfm:set_xattr(
          Auth#auth.session_id, {guid, Guid},
          #xattr{name = Name, value = Value},
          false, false
      ));
  
  create(#op_req{auth = Auth, data = Data, gri = #gri{id = Guid, aspect = json_metadata}}) ->
      JSON = maps:get(<<"application/json">>, Data),
  