You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You are guaranteed on Windows only that `address()` will not return a new value unless:
...
4. You call `relink()`, which requires closing and reopening the map because you cannot
rename a file with an open map on Windows.
which is true, but what you can do is link+unlink it which has almost the same effect, except you can't reuse the old filename until you release the handle. Might be a useful fallback for mapped_file_handle::relink and/or relink_or_clone_copy_unlink? It's useful, at least to me, to be able to rename a mapped file without changing address or having to copy the whole thing.
The text was updated successfully, but these errors were encountered:
To be clear, you're suggesting that instead of renaming the file with an open map, you just keep adding hard links until when you eventually tear down the map and close the file, all the links now marked delete on close will get cleaned up?
Yes, basically. Though I was only thinking about doing it once. I haven't thought through all the implications, In my case I create a temporary file which the user can choose to save later on, and with this workaround I can avoid waiting for all my threads to stop looking at the map so I can relink it, or having to copy it, for the sake of windows.
Currently the docs for mapped_file_handle say:
which is true, but what you can do is link+unlink it which has almost the same effect, except you can't reuse the old filename until you release the handle. Might be a useful fallback for mapped_file_handle::relink and/or relink_or_clone_copy_unlink? It's useful, at least to me, to be able to rename a mapped file without changing address or having to copy the whole thing.
The text was updated successfully, but these errors were encountered: