diff --git a/NEWS b/NEWS index 773057d..9bc6c65 100644 --- a/NEWS +++ b/NEWS @@ -1,7 +1,7 @@ Package: future.batchtools ========================== -Version: 0.7.2-9000 [2019-04-25] +Version: 0.7.2-9000 [2019-05-02] NEW FEATURES: @@ -10,6 +10,9 @@ NEW FEATURES: * Now a more informative error message is produced if a batchtools *.tmpl template file was not found. + * Setting option 'future.delete' to FALSE will now prevent removal of the + batchtools registry folders. + BUG FIXES: * Argument 'workers' could not be a function. diff --git a/R/BatchtoolsFuture-class.R b/R/BatchtoolsFuture-class.R index 9c1e1fd..9422d5b 100644 --- a/R/BatchtoolsFuture-class.R +++ b/R/BatchtoolsFuture-class.R @@ -640,6 +640,13 @@ delete.BatchtoolsFuture <- function(future, } } + ## Have user disabled deletions? + if (!getOption("future.delete", TRUE)) { + msg <- sprintf("Option 'future.delete' is FALSE - will not delete batchtools registry: %s", sQuote(path)) + mdebugf("delete(): %s", msg) + return(invisible(FALSE)) + } + ## Control batchtools info output oopts <- options(batchtools.verbose = debug) on.exit(options(oopts))