
Am Do., 15. Apr. 2021 um 13:00 Uhr schrieb Daniel Trstenjak < daniel.trstenjak@gmail.com>:
On Thu, Apr 15, 2021 at 11:05:25AM +0200, Sven Panne wrote:
Am Do., 15. Apr. 2021 um 10:24 Uhr schrieb Daniel Trstenjak < daniel.trstenjak@gmail.com>:
And it's the safest, because a move is an atomic operation [...]
... unless you are on Windows. ;-)
I thought it is if you ensure that the move is done on the same device or partition.
Which "move" do you mean? ReplaceFileA's return code exposes various levels of non-atomicity ( https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-replac...) and Transactional NTFS (e.g. MoveFileTransactedA) has already been deprecated ( https://docs.microsoft.com/en-us/windows/win32/fileio/deprecation-of-txf). Perhaps there are other, even more arcane variations on this conceptually simple operation on Windows, but I don't know... Supporting this madness in a cross-platform way is even more interesting.