anchor.diff:              CommonProvidersSet = ordsets:intersection([TargetProvidersSet, SourceProvidersSet]),
               case ordsets:is_element(oneprovider:get_provider_id(), CommonProvidersSet) of
                   true ->
  -                    rename_interspace(CTX, SourceEntry, TargetPath);
  +                    rename_interspace(CTX, SourceEntry, LogicalTargetPath);
                   false ->
  -                    rename_interprovider(CTX, SourceEntry, TargetPath)
  +                    rename_interprovider(CTX, SourceEntry, LogicalTargetPath)
               end
       end.
   
  
positive.code: %%--------------------------------------------------------------------
  -spec rename_interprovider(fslogic_worker:ctx(), fslogic_worker:file(),
      file_meta:path()) -> #fuse_response{} | no_return().
  rename_interprovider(#fslogic_ctx{session_id = SessId}, SourceEntry, TargetPath) ->
      {ok, SourcePath} = file_meta:gen_path(SourceEntry),
      {ok, SourceParent} = file_meta:get_parent(SourceEntry),
      SourcePathTokens = filename:split(SourcePath),
      TargetPathTokens = filename:split(TargetPath),
  
      for_each_child_file(SourceEntry,
          fun(Entry) ->
  
negative.code: %%%===================================================================
  
  %%--------------------------------------------------------------------
  %% @doc Transforms target path to required forms.
  %% @end
  %%--------------------------------------------------------------------
  -spec rename(fslogic_worker:ctx(), SourceEntry :: fslogic_worker:file(),
      LogicalTargetPath :: file_meta:path()) ->
      #fuse_response{} | no_return().
  rename(CTX, SourceEntry, LogicalTargetPath) ->
      {ok, Tokens} = fslogic_path:verify_file_path(LogicalTargetPath),
      CanonicalFileEntry = fslogic_path:get_canonical_file_entry(CTX, Tokens),
      {ok, CanonicalTargetPath} = file_meta:gen_path(CanonicalFileEntry),
      rename(CTX, SourceEntry, CanonicalTargetPath, LogicalTargetPath).
  
  %%--------------------------------------------------------------------
  %% Internal functions
  %%--------------------------------------------------------------------
  
  %%--------------------------------------------------------------------
  %% @doc Executes proper rename case to check permissions.
  %% For best performance use following arg types: path -> uuid -> document
  %% @end
  %%--------------------------------------------------------------------
  -spec rename(fslogic_worker:ctx(), SourceEntry :: fslogic_worker:file(),
      CanonicalTargetPath :: file_meta:path(),
      LogicalTargetPath :: file_meta:path()) ->
      #fuse_response{} | no_return().
  -check_permissions([{traverse_ancestors, 2}, {traverse_ancestors, {path, 3}}, {?delete, 2}]).
  rename(CTX, SourceEntry, CanonicalTargetPath, LogicalTargetPath) ->
      ?debug("Renaming file ~p to ~p...", [SourceEntry, CanonicalTargetPath]),
      case file_meta:get(SourceEntry) of
          {ok, #document{value = #file_meta{type = ?DIRECTORY_TYPE}} = FileDoc} ->
              rename_dir(CTX, FileDoc, CanonicalTargetPath, LogicalTargetPath);
          {ok, FileDoc} ->
              rename_file(CTX, FileDoc, CanonicalTargetPath, LogicalTargetPath)
      end.
  
  %%--------------------------------------------------------------------
  %% @doc Checks necessary permissions and renames directory
  %%--------------------------------------------------------------------
  -spec rename_dir(fslogic_worker:ctx(), SourceEntry :: fslogic_worker:file(),
      CanonicalTargetPath :: file_meta:path(),
      LogicalTargetPath :: file_meta:path()) ->
      #fuse_response{} | no_return().
  -check_permissions([{?delete_subcontainer, {parent, 2}}, {?add_subcontainer, {parent, {path, 3}}}]).
  rename_dir(CTX, SourceEntry, CanonicalTargetPath, LogicalTargetPath) ->
      case check_dir_preconditions(CTX, SourceEntry, CanonicalTargetPath) of
          #fuse_response{status = #status{code = ?OK}} ->
              rename_select(CTX, SourceEntry, CanonicalTargetPath, LogicalTargetPath);
          Error ->
              Error
      end.
  