Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-mv/blob/main/seed/host/tests/structfile.om # 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 Sign in to star 1 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-mv / seed / host / tests / structfile.om` 31 lines ยท 497 bytes Raw Blame History 1 note SPDX-License-Identifier: AGPL-3.0-only 2 note Combined gate: a struct value drives a native file operation in one program. 3 struct H x uint y ulong end 4 text path "structfile.tmp" 5 text body "ok\n" 6 fn main to int 7 h = new H 7 9 8 put h y 42 9 fd = int fopen path 0 len path 577 420 10 if lt fd 0 11 ret 1 12 end 13 n = write fd body 0 len body 14 r = fclose fd 15 u = unlink path 0 len path 16 if ne n long len body 17 ret 2 18 end 19 if ne r 0 20 ret 3 21 end 22 if ne u 0 23 ret 4 24 end 25 if eq get h x 7 26 if eq get h y 42 27 ret 0 28 end 29 end 30 ret 5 31 end