sink

expect abstract fun sink(file: Path, mustCreate: Boolean = false): Sink

Returns a sink that writes bytes to file from beginning to end. If file already exists it will be replaced with the new data.

Parameters

mustCreate

true to throw an IOException instead of overwriting an existing file. This is equivalent to O_EXCL on POSIX and CREATE_NEW on Windows.

Throws

if file cannot be written. A file cannot be written if its enclosing directory does not exist, if the current process doesn't have access to file, if there's a loop of symbolic links, or if any name is too long.

actual abstract fun sink(file: Path, mustCreate: Boolean): Sink
fun sink(file: Path): Sink
actual abstract fun sink(file: Path, mustCreate: Boolean): Sink
actual abstract fun sink(file: Path, mustCreate: Boolean): Sink
actual abstract fun sink(file: Path, mustCreate: Boolean): Sink