find_files: Find files

View source: R/find_files.R

find_filesR Documentation

Find files

Description

Find files based on a regex pattern matched against the file path. Mainly useful for interactive use.

Usage

find_files(
  pattern,
  dir = ".",
  markers = interactive() && getOption("sifr.use_markers") &&
    requireNamespace("rstudioapi", quietly = TRUE),
  fixed = FALSE,
  case_sensitive = TRUE,
  path_pattern = getOption("sifr.path_pattern"),
  path_case_sensitive = FALSE,
  recursive = TRUE,
  encoding = "unknown"
)

Arguments

pattern

⁠character scalar⁠. A pattern for which to look in filenames

dir

character scalar. A file system path to the directory in which files should be search.

markers

logical scalar. Display results in the RStudio source markers pane.

fixed

logical scalar. If FALSE pattern is interpreted as regular expression, else the string is matched as-is.

case_sensitive

logical scalar. If TRUE pattern is matched case sensitively.

path_pattern

character scalar. A regular expression pattern to match file paths against. Defaults to common source files for R (.R, .Rmd, Rnw, Rhtml, c, cpp). Please note that .Rd files are not included by default. You can modify the default behavior by setting the option() sifr.path_pattern.

path_case_sensitive

logical. If TRUE path_pattern is matched case sensitively.

recursive

logical scalar. If TRUE files are searched recursively starting from dir.

encoding

passed on to base::readLines()

See Also

open_files()


s-fleck/sifr documentation built on Oct. 15, 2023, 5:04 a.m.