# NOT RUN {
touch(f1 <- file.path(tempdir(), "first.R"))
touch(f2 <- file.path(tempdir(), "second.R"))
file_copy(f2, f1)
list.files(tempdir(), pattern = "first.*\\.R")
dir <- file.path(tempdir(), "subdir")
dir.create(dir)
file_copy(f1, dir)
touch(f1)
file_copy(f1, dir)
list.files(dir, pattern = "first.*\\.R")
# }
Run the code above in your browser using DataLab