write

fun write(contents: String)(source)

Replaces the file with contents so nothing ever reads a half-written file.