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 / seed / host / tests / faccess.om

26 lines · 384 bytes Raw Blame History
1note faccess: F_OK (0) on an existing path succeeds; a missing path returns a negative error.
2text p "acc.tmp"
3text miss "no.such.file"
4fn main to int
5fd = int fopen p 0 len p 578 420
6if lt fd 0
7ret 1
8end
9r = fclose fd
10if ne r 0
11ret 2
12end
13r = faccess p 0 len p 0
14if ne r 0
15ret 3
16end
17r = faccess miss 0 len miss 0
18if ge r 0
19ret 4
20end
21r = unlink p 0 len p
22if ne r 0
23ret 5
24end
25ret 0
26end