ac_detect_file() returns whether each file has at least one pattern match.
Arguments
- ac
An
<ac_automaton>object created byac_build().- path
A vector of file paths to search.
- stream
If
FALSE(default), each file is read into memory before searching. IfTRUE, files are searched as streams. Stream search requires an automaton built withmatch_kind = "standard".
Examples
ac <- ac_build(c("hello", "world"))
path <- tempfile()
writeLines("hello world", path)
ac_detect_file(ac, path)
#> [1] TRUE