Closed jakob-r closed 6 years ago
There typically already is a backup if something went wrong while writing the registry (https://github.com/mllg/batchtools/blob/master/R/saveRegistry.R). Thoughts?
I think in the case the "registry.new.Rds" existed but was 0kb.
So what is happening?
What can go wrong?
file.rename
destroy the from
and the to
at the same time?How I would do it:
This issue came up because the file system quota was exhausted. Maybe the file.rename()
operation failed here for some reasons. This is very hard to reproduce.
Your proposed solution would require an extra copy of the registry. This could slow things down. I'll wait if others have problems, too. Never experienced this myself.
At least you should stop()
if the result of file.rename()
is not TRUE. So in case it happens again we have a way to trace it back.
Ok this in now in the master. However, there is no real way to deal with this.
So that if the file is corrupted you can come back to the backup