klyn.io.Path.searchText
method
public searchText(notnull pattern as String, options as SearchOptions, notnull consumer as (SearchMatch) -> Boolean) as ULong
Description

Streams matches through a serialized callback, without collecting them. Returning false cancels all workers. File order is unspecified with more than one worker; callbacks run on workers in that case. Do not mutate options during the search.

Parameters
ParameterDescription
patternSearch pattern.
optionsSettings.
consumerReceives each match; false stops the search.
Returns

Number of delivered matches.

Throws
  • IOException for read/decode failures; callback errors propagate.
  • NullException if pattern, consumer is null at runtime; statically null arguments are rejected with TypeError.
Example

count = Path.cwd.searchText("TODO", SearchOptions(), lambda(hit): false)