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
Post a Comment