<div dir="ltr"><div dir="ltr">Am Do., 15. Apr. 2021 um 13:00 Uhr schrieb Daniel Trstenjak <<a href="mailto:daniel.trstenjak@gmail.com">daniel.trstenjak@gmail.com</a>>:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Thu, Apr 15, 2021 at 11:05:25AM +0200, Sven Panne wrote:<br>
> Am Do., 15. Apr. 2021 um 10:24 Uhr schrieb Daniel Trstenjak <<a href="mailto:daniel.trstenjak@gmail.com" target="_blank">daniel.trstenjak@gmail.com</a>>:<br>
> <br>
> And it's the safest, because a move is an atomic operation [...]<br>
> <br>
> <br>
> ... unless you are on Windows. ;-)<br>
<br>
I thought it is if you ensure that the move is done on the same device<br>
or partition.<br></blockquote><div><br></div><div>Which "move" do you mean? ReplaceFileA's return code exposes various levels of non-atomicity (<a href="https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-replacefilea">https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-replacefilea</a>) and Transactional NTFS (e.g. MoveFileTransactedA) has already been deprecated (<a href="https://docs.microsoft.com/en-us/windows/win32/fileio/deprecation-of-txf">https://docs.microsoft.com/en-us/windows/win32/fileio/deprecation-of-txf</a>). 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.</div></div></div>