Is an atomic file rename (with overwrite) possible on Windows? Is an atomic file rename (with overwrite) possible on Windows? windows windows

Is an atomic file rename (with overwrite) possible on Windows?


Win32 does not guarantee atomic file meta data operations. I'd provide a citation, but there is none - that fact that there's no written or documented guarantee means as much.

You're going to have to write your own routines to support this. It's unfortunate, but you can't expect win32 to provide this level of service - it simply wasn't designed for it.


In Windows Vista and Windows Server 2008 an atomic move function has been added - MoveFileTransacted()

Unfortunately this doesn't help with older versions of Windows.

Interesting article here on MSDN.