FileCreator

interface FileCreator(source)

Inheritors

Functions

Link copied to clipboard
abstract fun copy(source: Path, target: Path)

Copies all the bytes from the file at source to the file at target. This does not copy file metadata like last modified time, permissions, or extended attributes.

Link copied to clipboard
abstract fun write(file: Path, mustCreate: Boolean = false, writerAction: BufferedSink.() -> Unit)

Creates a sink to write file, executes writerAction to write it, and then closes the sink. This is a compact way to write a file.