Path.writeBytes

void writeBytes(const(ubyte)[] content, bool atomic = false) const

Writes bytes to the file (overwrites). Supports optional atomic replacement.

Parameters

contentThe byte array to write.
atomicIf true, write atomically using a temporary file and rename. Atomic-mode notes: - A symlinked destination is resolved first, so the link itself is preserved and its target receives the data (a dangling link is replaced by a regular file, since there is no target to write). - The destination's permission bits are carried over to the replacement file; new files are created with mode 0666 (umask applies). Ownership is not restored — the replacement file is owned by the writing process. - On POSIX the temporary file is fsynced before the rename so the content is crash-durable; the containing directory is not synced.