files_move.Rd
Moves older (defined in alphanumeric order) files from one directory to another directory. If directories do not exist, they will be automatically created.
files_move(path1, path2, file_sep="__", pattern=NULL, path2_name="__ARCH")
Original directory
Target directory in which the files should be moved
Separator for files
Pattern in file names to be searched for
Part of the name of path2
if argument
path2
is missing. If path2
is not provided, it has to be
a subdirectory of path1
.
if (FALSE) {
#############################################################################
# EXAMPLE 1: Move older files in '__ARCHIVE' directory
#############################################################################
# specify path
path1 <- "p:/IPN/Projects/PISA/Trend_2015/2__Data/All_Waves/"
# specify target directory which is an archive
path2 <- file.path( path1, "__ARCHIVE" )
# move files
files_move( path1, path2 )
}