file_cp_ts: Copy a file to a new location conditionally

Description Usage Arguments Examples

View source: R/99-utils.R

Description

By default the copying is only done if the new file is newer than an already existing file. The main goal of this function is to have one wrapper script which calls to this function which copy only files that have recently changed. This avoids lots of uneeded diffs in version control.

Usage

1
file_cp_ts(file_in, dir_out)

Arguments

file_in

The file to be moved

dir_out

The directory to be moved to

Examples

1
2
3
4
5
6
library("fs")
file_touch("test.xy")
file_cp_ts("test.xy", "log/")

# now both files are equal, no copying will be done
file_cp_ts("test.xy", "log/")

pat-s/2019-feature-selection documentation built on Dec. 24, 2021, 8:40 a.m.