write

inline fun Path.write(createDirs: Boolean = false, vararg options: OpenOption = emptyArray(), block: (OutputStream) -> Unit)

Same as outputStream except it also closes the OutputStream.

Return

the output of block

Parameters

createDirs

if true then the parent directory of this file is created. Defaults to false.