Detect the Presence of a Specific File in a Directory
Source:R/ngr_str_dir_from_file.R
ngr_str_dir_from_file.Rd
This function checks if a specific file exists in a given directory and optionally its subdirectories.
Arguments
- path_dir
character A single string representing the directory path to search.
- file_name
character A string specifying the name of the file to detect.
- recurse
logical Whether to search recursively in subdirectories. Default is
FALSE
.- ...
Additional arguments passed to
fs::dir_ls()
.
Value
character The directory path if the file is found; otherwise, a warning is issued.