diff --git a/R/cp.R b/R/cp.R index 7049137..efd770c 100644 --- a/R/cp.R +++ b/R/cp.R @@ -3,7 +3,8 @@ #' Copy files, overwriting existing files if necessary, and returning the result #' invisibly. #' -#' @param from source file names. +#' @param from source file names. Multiple filenames can be matched using +#' wildcard notation, such as \code{*.csv} to copy all CSV files. #' @param to destination file names, or directory. #' #' @return @@ -28,5 +29,5 @@ cp <- function(from, to) { - invisible(file.copy(from, to, overwrite=TRUE)) + invisible(file.copy(Sys.glob(from), to, overwrite=TRUE)) } diff --git a/man/cp.Rd b/man/cp.Rd index 6a3dcf1..7cdb3ae 100644 --- a/man/cp.Rd +++ b/man/cp.Rd @@ -7,7 +7,8 @@ cp(from, to) } \arguments{ -\item{from}{source file names.} +\item{from}{source file names. Multiple filenames can be matched using +wildcard notation, such as \code{*.csv} to copy all CSV files.} \item{to}{destination file names, or directory.} }