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

java - Cast from Object to List<String>: CastClassException -

How to set a border for android Imageview in Longpress? -

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -