FileWriter
class in package klyn.io

    public class FileWriter extends AbstractTextWriter:

AbstractTextWriter
└ FileWriter

Text writer backed by one file.

Opening the writer truncates the target file.

    import klyn.io

    try writer = FileWriter("notes.txt"):
    writer.writeLine("hello")

Constructors

Modifier and Type | Member | Description
--- | --- | ---
public | FileWriter `FileWriter(filePath as Path):` | Creates a file text writer and truncates the target file.
public | FileWriter `FileWriter(filePath as String):` | Creates a file text writer and truncates the target file.

Methods

Modifier and Type | Member | Description
--- | --- | ---
public override | close `close() as Void throws IOException:` | Closes the writer.
public override | write `write(readonly value as String) as Void throws IOException:` | Writes raw text to the file.

Methods inherited from AbstractTextWriter: close, write, writeChar, writeLine, writeLines
Methods inherited from TextWriter: write, writeChar, writeLine, writeLines
Methods inherited from AutoClosable: close