This library is in flux. APIs may change without notice. Generated from source on 6/15/2026.
Filesystem
File operations with phantom types for resource safety
fs.kz
Koru Standard Library: Filesystem
File operations with phantom types for resource safety
// ============================================================================
// HIGH-LEVEL API (convenience, no handle management)
// ============================================================================
//
// Read a file as a stream of lines — the EFFECT SHAPE (FRONTIERS gap 5,
// charter-ratified): `! line l` fires per line DURING the read (handlers
// complete before the buffer is freed — borrow-safe by construction),
// `| done n` delivers the line count after, `| failed e` the error.
// The old array shape (`| lines [][]const u8`) was a structural leaker:
// it returned allocator-owned slices no Koru caller could free.
~pub event read-lines {
path: []const u8
}
| done usize
| failed []const u8