anchor.diff:  -spec check_file_type_and_maybe_sync(storage_file_ctx:ctx(), #file_attr{}, file_ctx:ctx(), info(),
       boolean()) -> {result(), file_ctx:ctx() | undefined, storage_file_ctx:ctx()} | {error, term()}.
   check_file_type_and_maybe_sync(StorageFileCtx, FileAttr = #file_attr{type = FileMetaType}, FileCtx, Info, StorageFileCreated) ->
  -    {#statbuf{st_mode = StMode}, StorageFileCtx2} = storage_file_ctx:stat(StorageFileCtx),
  -    StorageFileType = file_meta:type(StMode),
  +    {StorageFileType, StorageFileCtx2} = get_file_type(StorageFileCtx),
       case {StorageFileType, FileMetaType, StorageFileCreated} of
           {Type, Type, true} ->
               maybe_update_file(StorageFileCtx2, FileAttr, FileCtx, Info);
  
positive.code:                     }}} ->
                          binary:longest_common_suffix([FileId, FileName]) =:= size(FileName);
                      (_) ->
                          false
                  end
              end, UuidsWithTreeIds),
              case Filtered of
  
negative.code:             end;
          _ ->
              false
      end.
  
  %% @private
  -spec get_file_type(storage_file_ctx:ctx()) -> {file_meta:type(), storage_file_ctx:ctx()}.
  get_file_type(StorageFileCtx) ->
      {#statbuf{st_mode = StMode}, StorageFileCtx2} = storage_file_ctx:stat(StorageFileCtx),
      StorageFileType = file_meta:type(StMode),
      {StorageFileType, StorageFileCtx2}.