Skip to contents

This function searches for files in a specified directory that match a given pattern and extracts the highest version number from those files.

Usage

get_file_version(parent_dir, file_name, add)

Arguments

parent_dir

A string representing the path to the directory where the files are located.

file_name

A string representing the setup name.

add

A string to be added to the file name pattern to match.

Value

The highest version number found among the matching files as a numeric value. Returns 0 if no matching files are found.

Examples

if (FALSE) { # \dontrun{
file_version <- get_file_version(parent_dir, save_name, '_nostr_') + 1
} # }