copy_file: copy file

Description Usage Arguments Details Value

Description

Copy a single file from one location to another

Usage

1
2
copy_file(from_file = NULL, to_dir = ".", json_data = NULL,
  tmp_loc = "/tmp", clean_file_fun = clean_filename)

Arguments

from_file

the location of the original file

to_dir

the location to copy the file to

json_data

the json meta information data

tmp_loc

temp location if you want to specify it

clean_file_fun

function used to rename the file

Details

We want to keep track of information about the copied files, so this function does some stuff to help us out. It strips special characters from the base file name, copies the file to a temp location, calculates the MD5 hash of the file, checks the JSON meta file for matches to the MD5, and if there are none, copies the renamed file to the copy location.

If a matching instance of MD5 hashes are found, then the file path is added to the entry for that file location.

If a matching file name is found but with a different MD5 hash, then the first 8 characters of the MD5 hash are appended to the file, and it is added to the database.

Value

list


MoseleyBioinformaticsLab/waitcopy documentation built on May 6, 2019, 11:20 a.m.