Skip to contents

empty_stage() retrieves the pipeline stage that produced an empty seekr_match result returned by seek() or seekr().

Empty results can happen at different stages of the pipeline:

  • "input": the input path was empty.

  • "list": no files were found by list_files().

  • "filter": all files were excluded by filter_files().

  • "match": files were searched, but no match was found.

For non-empty results, empty_stage() returns NULL.

Usage

empty_stage(x)

Arguments

x

A seekr_match object, returned by either seek() or seekr().

Value

Either NULL for non-empty results, or one of "input", "list", "filter", or "match" for empty results.

Examples

ext_path <- system.file("extdata", package = "seekr")
x <- seek("pattern_that_does_not_exist", path = ext_path)
empty_stage(x)
#> [1] "match"