klyn.io.Files.moveAtomic
method
public static moveAtomic(source as Path, destination as Path, replace as Boolean = false) as Void
Description

Publishes a completed regular file with one atomic filesystem rename. No copy/delete fallback is performed across filesystems. Source must be a regular file (no symlink); destination's parent must exist. The Path arguments are not mutated. Replacement is explicit and false by default.

Throws
  • IOException on failure; an existing destination is preserved. This guarantees atomic visibility, not a power-loss durability barrier. Example: Files.moveAtomic(Path("drawing.tmp"), Path("drawing.kpaint"), replace=true).