batchtools icon indicating copy to clipboard operation
batchtools copied to clipboard

option to overwrite registry file

Open nick-youngblut opened this issue 5 years ago • 4 comments

I have to specify a directory for makeRegistry due to https://github.com/mllg/batchtools/issues/237, but I always get a File at path already exists: error if I try to re-run the makeRegistry function. It would be helpful to have an option to overwrite the existing directory

nick-youngblut avatar Jun 12 '20 15:06 nick-youngblut

Another, likely better option, would be to just create a new subdirectory within the user-specified directory for each run. A UUID could be used for the subdirectory name

nick-youngblut avatar Jun 12 '20 15:06 nick-youngblut

Also, it appears that makeRegistry() doesn't use recursive = TRUE for dir.create

nick-youngblut avatar Jun 12 '20 15:06 nick-youngblut

I think this it out of scope for batchtools because it is a potentially subjective choice what the best approach is. You could just handle it yourself by writing a function generate_my_registry_dir("path/to/file") that performs the actions you like and returns the path to the desired registry (e.g. a subdirectory within path/to/file).

jakob-r avatar Jun 15 '20 11:06 jakob-r

That would require one to always create the function or source it. Optional parameters provide the user with the option to select one subjective choice or another. It was just a suggestion, but it's really only for convenience, so it's not a big deal.

nick-youngblut avatar Jun 15 '20 11:06 nick-youngblut