Copy files from one directory to another only if they don't already exist
Source:R/ngr_fs_copy_if_missing.R
ngr_fs_copy_if_missing.Rd
Recursively lists files in dir_in
and copies them to the same relative
path under dir_out
, skipping any files that already exist.
See also
Other fs:
ngr_fs_id_missing()
Examples
dir_in <- fs::dir_create(fs::path(tempfile(), "a"))
dir_out <- fs::dir_create(fs::path(tempfile(), "b"))
fs::file_create(fs::path(dir_in, "test.txt"))
ngr_fs_copy_if_missing(fs::path_dir(dir_in), fs::path_dir(dir_out))
fs::file_exists(fs::path(dir_out, "a", "test.txt"))
#> /tmp/RtmpeO7CWt/file21085eb9bd43/b/a/test.txt
#> FALSE