write

abstract suspend fun write(uri: CommonUri, block: suspend (BufferedSink) -> Unit): Boolean(source)

Opens a file or URI for writing and provides a BufferedSink. The sink is automatically closed after block execution. Returns true if successful, false otherwise.