Skip to contents

Flattens a hierarchical list of path elements into a character vector of full paths.

Usage

flatten_path_tree(path_tree, parent_path = NULL)

Arguments

path_tree

Directory tree. A nested list of named lists and character vectors.

parent_path

Optional parent path of path_tree. A character scalar.

Value

A character vector.

See also

Other path functions: draw_path_tree(), path_mod_time()

Examples

list("root_dir" = list("subdir1",
                       "subdir2" = list("file1.ext"),
                       "file2.ext")) |>
  pal::flatten_path_tree() |>
  pal::cat_lines()
#> root_dir
#> root_dir/subdir1
#> root_dir/subdir2
#> root_dir/subdir2/file1.ext
#> root_dir/file2.ext