interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / aienux / connector / gates / hostile / writer.om

24 lines · 427 bytes Raw Blame History
1note hostile probe: create the file named on stdin and write to it; prints the open result
2text m1 "open "
3text m2 "wrote\n"
4text nl "\n"
5fn main to int
6p = new uchar 512 0
7n = read 0 p 0 511
8if le n 1
9ret 2
10end
11m = sub ulong n 1
12fd = fopen p 0 m 577 420
13k = write 1 m1 0 len m1
14if lt fd 0
15put p 0 45
16put p 1 49
17k = write 1 p 0 2
18k = write 1 nl 0 len nl
19ret 0
20end
21k = write int fd m2 0 len m2
22k = write 1 m2 0 len m2
23ret 0
24end