How to recover power outage data using C ++ programming in windows

In my program, I write a file of my program states. I write a file many times to a file during program startup, because the program changes some variables that I need to store very often.

Now, if for some reason my power fails. Then most of the time I lose data in this file.

Please tell me some mechanism that can protect the data, even if there is a power failure. (I wrote a program in C ++ on Windows).

thank

+3
source share
5 answers

, ​​ SQL Server. . , , .

+2
0

, . :

, , , . , , . , (, B, 42), . , , .

, , , - (, ).

0

SQLite , . , ACID-, . ++ API.

0

FlushFileBuffers (win32 API) POSIX fsync ( POSIX), , . , , . D ACID.

, ... .

0

Source: https://habr.com/ru/post/1741431/


All Articles