fileio.sleela
impl/examples/fileio.sleela · 21 line(s) · sleela
#sleela 2.1
class FileIO {
static int readEnd;
static int writeEnd;
static void writer() {
write(writeEnd, "hello from Sleela pipe");
close(writeEnd);
}
static void main() {
readEnd = pipe();
writeEnd = pipePeer(readEnd);
spawn(writer);
print(read(readEnd));
close(readEnd);
join();
}
}