find_latest_file: Find the latest version of a file

View source: R/find_latest_file.R

find_latest_fileR Documentation

Find the latest version of a file

Description

This will return the latest created file matching the criteria. It uses fs::dir_info() to find the files then picks the one with the latest birthtime

Usage

find_latest_file(directory, regexp)

Arguments

directory

The directory to look in

regexp

a regular expression passed to fs::dir_info() to search for the file

Value

the fs::path() to the file

Examples

## Not run: 
find_latest_file(get_lookups_dir(),
  regexp = "Scottish_Postcode_Directory_.+?\\.rds"
)

## End(Not run)

shintoLamp/bluenile documentation built on Aug. 6, 2022, 6:29 a.m.