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/links.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 / links.om` 77 lines ยท 1149 bytes Raw Blame History 1 note link/symlnk take a packed two-path list: u16 count 2, then each u16 length + bytes. 2 text a "pl1.tmp" 3 text b "pl2.tmp" 4 text c "pl3.tmp" 5 text body "abcd" 6 fn main to int 7 fd = int fopen a 0 len a 578 420 8 if lt fd 0 9 ret 1 10 end 11 w = write fd body 0 len body 12 if ne w long len body 13 ret 2 14 end 15 r = fclose fd 16 if ne r 0 17 ret 3 18 end 19 list = new uchar 64 0 20 put list 0 2 21 put list 1 0 22 put list 2 uchar len a 23 put list 3 0 24 i = ulong 0 25 while lt i len a bound 64 26 put list add 4 i get a i 27 i = add i 1 28 end 29 off = add 4 len a 30 put list off uchar len b 31 put list add off 1 0 32 i = ulong 0 33 while lt i len b bound 64 34 put list add add off 2 i get b i 35 i = add i 1 36 end 37 total = add add off 2 len b 38 r = link list 0 total 39 if ne r 0 40 ret 4 41 end 42 st = new uchar 128 0 43 r = stat b 0 len b st 0 128 44 if ne r 0 45 ret 5 46 end 47 if ne get st 20 2 48 ret 6 49 end 50 i = ulong 0 51 while lt i len c bound 64 52 put list add add off 2 i get c i 53 i = add i 1 54 end 55 r = symlnk list 0 total 56 if ne r 0 57 ret 7 58 end 59 buf = new uchar 64 0 60 n = readlnk c 0 len c buf 0 64 61 if ne n long len a 62 ret 8 63 end 64 r = unlink c 0 len c 65 if ne r 0 66 ret 9 67 end 68 r = unlink b 0 len b 69 if ne r 0 70 ret 10 71 end 72 r = unlink a 0 len a 73 if ne r 0 74 ret 11 75 end 76 ret 0 77 end