mllg / batchtools

Tools for computation on batch systems
https://mllg.github.io/batchtools/
GNU Lesser General Public License v3.0
172 stars 51 forks source link

option to overwrite registry file #262

Open nick-youngblut opened 4 years ago

nick-youngblut commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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

jakob-r commented 4 years ago

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).

nick-youngblut commented 4 years ago

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.