as_seekr_path() converts paths to the normalized format used internally
by seekr for listing, filtering, matching, and replacement.
This is useful when writing custom exclude functions, comparing paths
with seekr results, or building file vectors before calling
filter_files() or match_files().
Details
A seekr path is a character path that has been:
expanded, so
~is resolved,normalized, so redundant path components are removed,
resolved to an absolute path,
represented with forward slashes.
Where seekr paths are created
list_files() returns seekr paths: it starts from user-supplied
directories and returns the listed files as normalized absolute paths.
filter_files() and match_files() normalize their input path before
filtering or matching. This means path-based filters such as
path_pattern are applied to seekr paths, regardless of whether the input
paths were originally relative, absolute, or written with
platform-specific separators.
Examples
as_seekr_path(".")
#> [1] "/home/runner/work/seekr/seekr/docs/reference"
as_seekr_path(c(".", "~"))
#> [1] "/home/runner/work/seekr/seekr/docs/reference"
#> [2] "/home/runner"
