sink

open suspend override fun sink(path: Path, append: Boolean): Sink(source)

Creates and returns a Sink for the given file path, allowing data to be written to the file. It ensures that parent directories of the file path are created if they do not already exist. The operation is performed in the IO context.

Return

A buffered Sink for the specified path, ready for writing.

Parameters

path

The file path where the sink is to be created.

append

A boolean value indicating whether to append data to the file if it already exists (true) or overwrite the file (false).