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/lstat.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 / lstat.om` 60 lines ยท 976 bytes Raw Blame History 1 note stat follows the final symlink (size 4); lstat reports S_IFLNK in st_mode at byte 16. 2 text a "ls1.tmp" 3 text c "ls2.tmp" 4 text body "abcd" 5 fn main to int 6 fd = int fopen a 0 len a 578 420 7 if lt fd 0 8 ret 1 9 end 10 w = write fd body 0 len body 11 r = fclose fd 12 list = new uchar 64 0 13 put list 0 2 14 put list 1 0 15 put list 2 uchar len a 16 put list 3 0 17 i = ulong 0 18 while lt i len a bound 64 19 put list add 4 i get a i 20 i = add i 1 21 end 22 off = add 4 len a 23 put list off uchar len c 24 put list add off 1 0 25 i = ulong 0 26 while lt i len c bound 64 27 put list add add off 2 i get c i 28 i = add i 1 29 end 30 total = add add off 2 len c 31 r = symlnk list 0 total 32 if ne r 0 33 ret 2 34 end 35 st = new uchar 128 0 36 r = stat c 0 len c st 0 128 37 if ne r 0 38 ret 3 39 end 40 if ne get st 48 4 41 ret 4 42 end 43 r = lstat c 0 len c st 0 128 44 if ne r 0 45 ret 5 46 end 47 m = add ulong get st 16 shl ulong get st 17 ulong 8 48 if ne and m ulong 61440 ulong 40960 49 ret 6 50 end 51 r = unlink c 0 len c 52 if ne r 0 53 ret 7 54 end 55 r = unlink a 0 len a 56 if ne r 0 57 ret 8 58 end 59 ret 0 60 end