anchor.diff:  %%--------------------------------------------------------------------
   %% @doc Checks preconditions for renaming regular file.
   %%--------------------------------------------------------------------
  --spec check_reg_preconditions(fslogic_worker:ctx(), fslogic_worker:file(),
  +-spec check_reg_preconditions(fslogic_worker:ctx(),
       file_meta:path()) -> ok | logical_file_manager:error_reply().
  -check_reg_preconditions(#fslogic_ctx{session_id = SessId}, _SourceEntry, CanonicalTargetPath) ->
  -    case logical_file_manager:stat(SessId, {path, CanonicalTargetPath}) of
  +check_reg_preconditions(#fslogic_ctx{session_id = SessId}, LogicalTargetPath) ->
  +    case logical_file_manager:stat(SessId, {path, LogicalTargetPath}) of
           {error, ?ENOENT} ->
               ok;
           {ok, #file_attr{type = Type}} ->
  
positive.code:     ok | logical_file_manager:error_reply().
  -check_permissions([{?delete_object, {parent, 2}}, {?add_object, {parent, {path, 3}}}]).
  rename_file(CTX, SourceEntry, CanonicalTargetPath, LogicalTargetPath) ->
      case check_reg_preconditions(CTX, SourceEntry, CanonicalTargetPath) of
          ok ->
              rename_select(CTX, SourceEntry, CanonicalTargetPath, LogicalTargetPath);
          Error ->
  
negative.code:                 ?DIRECTORY_TYPE ->
                      {error, ?EISDIR};
                  _ ->
                      logical_file_manager:unlink(SessId, {path, LogicalTargetPath})
              end
      end.
  
  