% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ingest.R
\name{detect_files}
\alias{detect_files}
\title{Detect current and previous dataset files}
\usage{
detect_files(config)
}
\arguments{
\item{config}{Named list. Merged configuration as returned by
\code{\link{load_config}}.}
}
\value{
A named list with elements \code{current} (character path) and
  \code{previous} (character path or \code{NULL}).
}
\description{
Resolves the current and previous file paths from the configuration. If
\code{current_file} is set explicitly, it is used directly. Otherwise the
two most recently modified files in \code{folder} are used.
}
\examples{
cfg_dir <- system.file("demonstrations/config", package = "dqcheckr")
cfg <- load_config("starwars_csv", config_dir = cfg_dir)
cfg$current_file <- system.file("demonstrations/data/starwars.csv",
                                 package = "dqcheckr")
files <- detect_files(cfg)
files$current

}
