write

inline fun File.write(excl: OpenExcl?, data: Buffer)(source)

Writes the contents of a Buffer to the file associated with the abstract pathname. The File will be truncated if it exists.

docs

Parameters

excl

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

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

If Node.js is not being used.


fun File.write(excl: OpenExcl?, appending: Boolean, data: Buffer)(source)

Writes the contents of a Buffer to the file associated with the abstract pathname.

docs

Parameters

excl

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

appending

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

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

If Node.js is not being used.