[Haskell-cafe] How to move files?

Sven Panne svenpanne at gmail.com
Thu Apr 15 14:14:20 UTC 2021


Am Do., 15. Apr. 2021 um 13:00 Uhr schrieb Daniel Trstenjak <
daniel.trstenjak at 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 at 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-replacefilea)
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20210415/e81f7787/attachment.html>


More information about the Haskell-Cafe mailing list