klyn.io.Path.write
method

    public write(content as String) as Void throws IOException:

Description

Writes text content to this path, replacing existing file content.

This helper is intended for simple full-file writes. Use `FileWriter` directly when you need incremental writes, line-oriented output, or explicit control over the writer lifetime.

Parameters

- content Text content to write.

Throws

- IOException if this path cannot be opened or written as a file. ```klyn import klyn.io path = Path.tempDir.resolve("notes.txt") path.write("Hello") print(path.read()) ```