ez.cp: copy

ez.cpR Documentation

copy

Description

copy

Usage

ez.cp(from, to, overwrite = TRUE)

Examples

support c('a.txt','b.txt')
to folder does not have to exist already
e.g.,
1) both works ez.cp('a.txt','folder'), ez.cp('a.txt','folder/b.txt')
the former copy still has the same name 'a.txt', the latter copy new name 'b.txt'
also ez.cp(c('a.txt','b.txt'),'folder')
2) folder: ez.cp('a','b')-->if b not exists, cp contents of a to b; if b exist, a becomes subfolder of b
kinda combines rn and mv
3) regular expression
flist <- list.files("patha", "^filea.+[.]csv$", full.names = TRUE)
file.copy(flist, "pathb")

jerryzhujian9/ezmisc documentation built on March 9, 2024, 12:44 a.m.