Skip to contents

For a given path a/b/c/d, all the parent paths a, a/b, a/b/c and the path itself (a/b/c/d) are returned.

Usage

all_path_levels(path)

Arguments

path

one character string representing a file path

Value

vector of character representing all parent paths and the path itself as the last element

Examples

paths <- kwb.fakin:::all_path_levels("this/is/a/long/path")
#> Splitting paths ... ok. (0.00s) 
kwb.file:::to_subdir_matrix(paths)
#>      [,1]   [,2] [,3] [,4]   [,5]  
#> [1,] "this" ""   ""   ""     ""    
#> [2,] "this" "is" ""   ""     ""    
#> [3,] "this" "is" "a"  ""     ""    
#> [4,] "this" "is" "a"  "long" ""    
#> [5,] "this" "is" "a"  "long" "path"