openSink

suspend fun openSink(path: String, append: Boolean = false, overwrite: Boolean = true): Sink

Opens and returns a buffered kotlinx.io.Sink for writing to the file at path. Closing the returned Sink flushes pending data and closes the underlying SmbFile handle.

Parameters

append

If true, appends to the end of an existing file (or creates it if absent).

overwrite

When append is false, true overwrites an existing file (FILE_OVERWRITE_IF) whereas false requires creating a new file (FILE_CREATE).