// stdin is read into a buffer and the part read is echoed to stdout. // expect: run // grant: input=io.read // grant: out=io.write // stdin: echo me // result: null // stdout: echo me // phase: 6 // spec: docs/spec/15-source-language.md module demo.echostdin fn main(input: cap, out: cap) -> void effects [io.read, io.write] { var buf: [u8; 16] = zero; let n = io.stdin_read(input, mut buf) or trap; io.stdout_write(out, ref buf[0..n]) or trap; }