c++ - Replace file with another in an atomic operation (Windows) -


i have 2 files: , b. need replace b a, while b opened in program.

the following approach:

movefile rename b c, rename b, delete c

works fine. need atomic way that, because if 1 rename fails data left in inconsistent state.

i tried movefileex movefile_replace_existing flag, doesn't work when file b opened program. same replacefile function. other ideas? thank you


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -