get.file.copy: Copies files from one directory to another

Description Usage Arguments Details Author(s) See Also Examples

Description

From given directory dir.in, copies files into dir.out. Either list of file names in fname, or all files from dir.in that start from given prefix and end with ending and contain keyword key. If during copying uncompressing files ending with ".txt.bz2" is needed, set untarbz to TRUE.

Usage

1
2
get.file.copy(dir.in, dir.out, fname = "", prefix = "", key = "", ending = "", 
untarbz=FALSE, verbal = TRUE)

Arguments

dir.in

The name of directory which contains files that need to be copied.

dir.out

The name of directory to which files should be copied.

fname

The list of file names (should be empty if you want it to find files itself given specifications of prefix, key and ending).

prefix

The beginning of the file names that need to be copied.

key

Any keyword that uniquely distinguishes the files from others.

ending

The ending of the file names that need to be copied.

untarbz

Flag whether or not to untar encountered compressed files with ".tar.bz2" ending.

verbal

Flag whether or not to print error messages if files with prefix, key and ending could not be found. This flag only matters if fname="".

Details

This function can be used in two ways:

1. Either user provides a list of filenames that need to be copied over to dir.out directory, in which case all prefix, key and ending will be ignored.

2. Or fname="" and some of the 3 parameters prefix, key and ending are set. In which case the program will search for files in dir.in that fulfill the specifications.

This function is basically file.copy, only it allows to pass in a list instead of a single file, and takes input in format that is similar to all other preprocessing functions in GenMOSS.

Author(s)

Olia Vesselova

See Also

pre0.dir.create

Examples

1
print("See the demo 'gendemo'.")

Example output

[1] "See the demo 'gendemo'."

genMOSSplus documentation built on May 1, 2019, 10:31 p.m.