On Linux, we can memmap a file, delete the underlying file and still read from the mapped memory. Windows doesn’t seem to allow you to delete a file if it’s currently mapped.
Is it possible to mimic the behaviour of mem-mapped POSIX files on Windows, so we can delete the file and still read from the map?
I have an example gist here that demonstrates what I’m trying to do.
One workaround I was thinking of was copying the file contents into a
Vec or something on Windows, unmapping and deleting that way, but it’d be great if there was some magic combination of flags that would do it.