Description
On some file systems operations like writing and deleting can be a bit slow and can sometimes fail. It would be nice in these cases to use a temporary directory for intermediate steps. For instance writing of chunks could occur in a temporary directory with each chunk only getting moved in once the operation completes. Also deleting can simply move the content into a temporary directory and perform the deletion. As operations like rename
are atomic on POSIX systems, this ensures at the end of operations like writing and deleting content that the DirectoryStore
is never in an incomplete state. Further operations like deletion could be more easily performed in parallel as the content already appears to be deleted even though it merely got moved to a temporary directory somewhere where it is still getting cleaned up.