Updates the regular expression and/or recurse argument that were provided when a directory was configured (using batch_config()).

batch_reconfig_fileset(path, regexp = NULL, recurse = NULL)

Arguments

path

A string of the path to the directory with the files for processing.

regexp

A string of a regular expression. Only non-hidden file names which match the regular expression will be batch processed.

recurse

A flag specifying whether to recurse into path's subdirectories.

Value

An invisible character vector of the paths to the files remaining to be processed.

Details

batch_reconfig_fileset() is useful for including or excluding particular files.

It should be noted that batch_reconfig_fun() does not alter the configuration time.

In order to process previously failed files batch_run() should be called with failed = NA or failed = TRUE.

Examples

path <- tempdir()
write.csv(mtcars, file.path(path, "file1.csv"))
batch_config(function(x) TRUE, path, regexp = "[.]csv$")
batch_config_read(path)
#> $time
#> [1] "2022-06-18 00:15:26 UTC"
#> 
#> $regexp
#> [1] "[.]csv$"
#> 
#> $recurse
#> [1] FALSE
#> 
#> $fun
#> function(x) TRUE
#> <environment: 0x7f9695ee52e8>
#> 
#> $dots
#> list()
#> 
batch_reconfig_fileset(path, regexp = "file\\d+[.]csv$")
batch_config_read(path)
#> $time
#> [1] "2022-06-18 00:15:26 UTC"
#> 
#> $regexp
#> [1] "file\\d+[.]csv$"
#> 
#> $recurse
#> [1] FALSE
#> 
#> $fun
#> function(x) TRUE
#> <environment: 0x7f96954b3d08>
#> 
#> $dots
#> list()
#> 
batch_cleanup(path, force = TRUE, remaining = TRUE)
unlink(file.path(path, "file1.csv"))