anchor.diff:      {more, #list_result{}};
   process_current_dir(UserCtx, FileCtx, State) ->
       Path = build_current_dir_rel_path(State),
  -    case not matches_prefix(Path, State) andalso Path > State#state.prefix of
  -        false ->
  +    % directories with path that not match given prefix, but is a prefix of this given prefix must be listed, 
  +    % as they are ancestor directories to files matching this given prefix
  +    IsAncestorDir = case Path of
  +        <<".">> -> true; % listing root directory
  +        _ -> str_utils:binary_starts_with(State#state.prefix, Path)
  +    end,
  +    case matches_prefix(Path, State) orelse IsAncestorDir of
  +        true ->
               {ListOpts, UpdatedState} = init_current_dir_processing(State),
               process_current_dir_in_batches(UserCtx, FileCtx, ListOpts, UpdatedState, #list_result{});
  -        true ->
  +        false ->
               {done, #list_result{}}
       end.
   
  
positive.code:             false -> {cont, ToReturn}
          end
      end, {UpdatedAccListResult, 0}, Children),
      case {result_length(Res) >= Limit, IsLast} of
          {true, _} ->
              ProgressMarker = case IsLast and (FinalProcessedFileCount == length(Children)) of
                  true -> done;
                  false -> more
              end,
              {ProgressMarker, Res};
          {false, true} ->
              {done, Res};
          {false, false} ->
              NextListOpts = maps:with([last_tree, last_name], ExtendedInfo),
              process_current_dir_in_batches(
                  UserCtx, FileCtx2, NextListOpts, State#state{limit = Limit - result_length(Res)}, Res)
  
negative.code: 
  
  %% @private
  -spec process_subtree(user_ctx:ctx(), file_ctx:ctx(), state()) ->
      {progress_marker(), result()}.
  process_subtree(UserCtx, ChildCtx, #state{current_dir_path_tokens = CurrentPathTokens} = State) ->
      case get_file_attrs(UserCtx, ChildCtx) of
          #file_attr{type = ?DIRECTORY_TYPE, name = Name, guid = G} ->
              {ProgressMarker, NextChildrenRes} = process_current_dir(UserCtx, ChildCtx,
  