google / mozc

Mozc - a Japanese Input Method Editor designed for multi-platform
Other
2.32k stars 330 forks source link

Remove the dependency on Transactional NTFS (TxF) APIs #873

Closed yukawa closed 5 months ago

yukawa commented 5 months ago

Description

Transactional NTFS (TxF) has been deprecated. Also ReFS does not support these APIs. We should stop relying on it.

Here is how Mozc uses Transactional NTFS API. https://github.com/google/mozc/blob/e80673135460f1671e134181146b719deb600342/src/base/file_util.cc#L355-L396

As for the above use case, here is the relevant part in the migration guide.

Applications updating a single file with "document-like" data

Many applications which deal with "document-like" data tend to load the entire document into memory, operate on it, and then write it back out to save the changes. The needed atomicity here is that the changes either are completely applied or not applied at all, as an inconsistent state would render the file corrupt. A common approach is to write the document to a new file, then replace the original file with the new one. One method to do this is with the ReplaceFile API.

Version or commit-id

e80673135460f1671e134181146b719deb600342

Environment