Searches path provided in the search_path and returns most recent file or directory.

most_recent(search_path, type = c("any", "file", "directory", "symlink"))

Arguments

search_path

A path to search

type

Type of an object to return. Defaults to any, available options correspond to type argument in fs::dir_ls.

Value

A path object.

Details

The function makes use of the directory listing function available in the fs package - fs::dir_ls and consequently can return any objects that fs::dir_ls can identify.

Examples

most_recent(tempdir())
#> /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/RtmpObl2aQ/downlit