Creating this PR to make comparisons easy - this isn't quite ready for merging though, as the second test I added is experiencing some noise from the other tests. I'm going to be away from my machine for the rest of the day though, and didn't want to hold you up.
The changes are using :gproc to keep track of all the files that are currently open inside of Store.File, and then closing them before removing or renaming them. Interestingly, the ensure_exclusive_access/1 function was flummoxed by the rename issue, because the _.compact file was checked when opened, but not checked again when renamed.
If you've never used :gproc before, its a really solid process registry, and has a really good pedigree.
Creating this PR to make comparisons easy - this isn't quite ready for merging though, as the second test I added is experiencing some noise from the other tests. I'm going to be away from my machine for the rest of the day though, and didn't want to hold you up.
The changes are using
:gproc
to keep track of all the files that are currently open inside ofStore.File
, and then closing them before removing or renaming them. Interestingly, theensure_exclusive_access/1
function was flummoxed by the rename issue, because the_.compact
file was checked when opened, but not checked again when renamed.If you've never used
:gproc
before, its a really solid process registry, and has a really good pedigree.