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/chmod.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 / chmod.om` 37 lines ยท 635 bytes Raw Blame History 1 note chmod: path permissions through fchmodat; mode 0600 is 384, checked in st_mode at byte 16. 2 text p "mode.tmp" 3 text miss "no.such.file" 4 fn main to int 5 fd = int fopen p 0 len p 578 420 6 if lt fd 0 7 ret 1 8 end 9 r = fclose fd 10 if ne r 0 11 ret 2 12 end 13 r = chmod p 0 len p 384 14 if ne r 0 15 ret 3 16 end 17 buf = new uchar 128 0 18 r = stat p 0 len p buf 0 128 19 if ne r 0 20 ret 4 21 end 22 m = add ulong get buf 16 shl ulong get buf 17 ulong 8 23 m = add m shl ulong get buf 18 ulong 16 24 m = add m shl ulong get buf 19 ulong 24 25 if ne and m ulong 4095 ulong 384 26 ret 5 27 end 28 r = chmod miss 0 len miss 384 29 if ge r 0 30 ret 6 31 end 32 r = unlink p 0 len p 33 if ne r 0 34 ret 7 35 end 36 ret 0 37 end