Return filepaths from arguments. These filepaths can then be used to identify files/folders for sending to the Docker container.

filestosend_get(arglist, wd = NULL)

Arguments

arglist

Character vector of arguments

wd

Working directory in which to look for files

Value

Character vector

Examples

library(outsider.base) # set-up: create wd and files to send wd <- file.path(tempdir(), 'results') dir.create(wd) file1 <- file.path(wd, 'file1') file.create(file1)
#> [1] TRUE
file2 <- file.path(wd, 'file2') file.create(file2)
#> [1] TRUE
# identify files to be sent to container arglist <- c('-in', file1, '-out', file2) (filestosend_get(arglist = arglist))
#> [1] "/tmp/Rtmpdqh5Q5/results/file1" "/tmp/Rtmpdqh5Q5/results/file2"
# works with -wd arglist <- c('-in', 'file1', '-out', 'file2', '-wd', wd) (filestosend_get(arglist = arglist, wd = wd))
#> [1] "/tmp/Rtmpdqh5Q5/results/file1" "/tmp/Rtmpdqh5Q5/results/file2"
# clean-up unlink(wd, recursive = TRUE)