4 ms·
> For one or the other reason, fork() has become in many discussion of posix on windows something of a fetish. how about this one? fopen + mmap + unlink Afai
by the8472 11y ago
> For one or the other reason, fork() has become in many discussion of posix on windows something of a fetish.
how about this one?
fopen + mmap + unlink
Afaik windows APIs forbid deleting mmaped files.
- poizan42 11y agoNot if they are opened with FILE_SHARE_DELETE.
- the8472 11y agoright, but it's still not the same as unlink it seems: http://blogs.msdn.com/b/oldnewthing/archive/2004/06/07/150047.aspx http://blogs.msdn.com/b/oldnewthing/archive/2004/06/07/15004...
- mpixorg 11y agoWith FILE_SHARE_DELETE there shouldn't be any particular problem, but I certainly want to test this with the posix flags you had in mind. Do you happen to have a minimal example that you deem problematic on Windows?
- the8472 11y agohas been a while since I tried it. it was basically open rw, set length, mmap from two 2 processes to have shared memory, unlink & close. expected behavior is to have a chunk of shared memory without the tempfile in the directory tree
- wfunction 11y agoIf you delete the backing file of (or perhaps even close its handle -- I don't remember) a memory-mapped file, you get VERY bizarre behavior in Windows. I don't remember what it was, but I remember I did it and the behavior I got was quite nonsensical.