anchor.diff:                  false
               end
           end}
  -
  -    }
  +    },
  +    optional => #{<<"createAttempts">> => {integer, {between, 1, 200}}}
   };
   
   data_spec(#op_req{operation = create, gri = #gri{aspect = attrs}}) -> #{
  
positive.code: -include("op_logic.hrl").
  -include("modules/logical_file_manager/lfm.hrl").
  -include_lib("ctool/include/api_errors.hrl").
  
  -export([op_logic_plugin/0]).
  -export([
  
negative.code:             SpaceId = file_id:guid_to_space_id(Guid),
              op_logic_utils:assert_space_supported_locally(SpaceId)
      end.
  
  
  %% @private
  -spec create_file(
      SessionId :: session:id(),
      ParentGuid :: file_id:file_guid(),
      Name :: file_meta:name(),
      Mode :: undefined | file_meta:mode(),
      Type :: file | dir,
      Counter :: non_neg_integer(),
      Retries :: non_neg_integer()
  ) ->
      {ok, file_id:file_guid()} | no_return().
  create_file(SessId, ParentGuid, Name, Mode, Type, Counter, Counter) ->
      ?check(create_file(SessId, ParentGuid, Name, Mode, Type));
  create_file(SessId, ParentGuid, OriginalName, Mode, Type, Counter, Retries) ->
      Name = case Counter of
          0 ->
              OriginalName;
          _ ->
              RootName = filename:rootname(OriginalName),
              Ext = filename:extension(OriginalName),
              str_utils:format_bin("~s(~B)~s", [RootName, Counter, Ext])
      end,
      case create_file(SessId, ParentGuid, Name, Mode, Type) of
          {ok, Guid} ->
              {ok, Guid};
          {error, ?EEXIST} ->
              create_file(
                  SessId, ParentGuid, OriginalName, Mode, Type,
                  Counter + 1, Retries
              );
          {error, Errno} ->
              throw(?ERROR_POSIX(Errno))
      end.
  
  
  %% @private
  -spec create_file(
      SessionId :: session:id(),
      ParentGuid :: file_id:file_guid(),
      Name :: file_meta:name(),
      Mode :: undefined | file_meta:mode(),
      Type :: file | dir
  ) ->
      {ok, file_id:file_guid()} | {error, term()}.
  create_file(SessionId, ParentGuid, Name, Mode, file) ->
      lfm:create(SessionId, ParentGuid, Name, Mode);
  create_file(SessionId, ParentGuid, Name, Mode, dir) ->
      lfm:mkdir(SessionId, ParentGuid, Name, Mode).
  
  
  %%--------------------------------------------------------------------
  