sink

abstract suspend fun sink(path: Path, append: Boolean = false): Sink(source)

Creates and returns a Sink for the given path. The Sink can be used to write data to the file or directory represented by the specified path.

Return

A Sink instance for writing to the specified path.

Parameters

path

The path where the sink will be created, representing the file or directory target.

append

A boolean indicating whether to append to the file if it exists. Defaults to false, meaning the file will be overwritten if it exists.