The current atomic write is somewhat broken as the temporary files are
created inside the base directory, and so count as potential keys (and
can conflict). Move these temporary files in the TempDir specified by
the user so that they can't conflict with future keys.
Note that the TempDir must be on the same device/partition/mount or the
atomic Rename will fail across partition.
Atomic write will not happen if TempDir is left empty.
The current atomic write is somewhat broken as the temporary files are created inside the base directory, and so count as potential keys (and can conflict). Move these temporary files in the TempDir specified by the user so that they can't conflict with future keys.
Note that the TempDir must be on the same device/partition/mount or the atomic Rename will fail across partition.
Atomic write will not happen if TempDir is left empty.