Skip to main content

Function: moveDirAtomic()

moveDirAtomic(src, dest): Promise<void>

Atomically moves src to dest by rename, retrying on transient Windows errors (ENOENT, EPERM, EBUSY) before falling back to a copy+delete when all retries are exhausted.

On Windows Docker / Windows Server containers, MoveFileEx can spuriously return ERROR_FILE_NOT_FOUND (ENOENT) or a sharing-violation even when both paths are valid. Retrying with back-off resolves the majority of these transient failures; the copy+delete fallback handles the rare case where the rename keeps failing (e.g. cross-device move).

Parameters

src

string

dest

string

Returns

Promise<void>