writeUtf8

@JvmName(name = "writeUtf8To")
fun File.writeUtf8(excl: OpenExcl?, appending: Boolean, text: String): File(source)

Writes the full contents of text to the file (as UTF-8).

Return

The File for chaining operations.

Parameters

excl

The OpenExcl desired for this open operation. If null, then OpenExcl.MaybeCreate.DEFAULT will be used.

appending

If true, text written to this file will occur at the end of the file. If false, the file will be truncated if it exists.

text

to write to the file.

See also

Throws

If there was a failure to open the File for the provided excl argument, if the File points to an existing directory, or if the filesystem threw a security exception.

UnsupportedOperationException

On Kotlin/JS-Browser.


@JvmName(name = "writeUtf8To")
inline fun File.writeUtf8(excl: OpenExcl?, text: String): File(source)

Writes the full contents of text to the file (as UTF-8). The File will be truncated if it exists.

Return

The File for chaining operations.

Parameters

excl

The OpenExcl desired for this open operation. If null, then OpenExcl.MaybeCreate.DEFAULT will be used.

text

to write to the file.

See also

Throws

If there was a failure to open the File for the provided excl argument, if the File points to an existing directory, or if the filesystem threw a security exception.

UnsupportedOperationException

On Kotlin/JS-Browser.