Module Operator.Lister

Lister Operations

Module for streaming directory listings.

val next : Opendal_core.Operator.lister -> (Opendal_core.Operator.entry option, string) Stdlib.result

next lister gets the next entry from the directory listing.

  • parameter lister

    The lister instance

  • returns

    Some entry if available, None if no more entries

@example

  let rec process_all lister =
    match Lister.next lister with
    | Ok (Some entry) ->
        printf "Processing: %s\n" (Entry.name entry);
        process_all lister
    | Ok None ->
        print_endline "Finished processing all entries"
    | Error err ->
        printf "Error: %s\n" err
  in
  process_all my_lister