interplane.Get Omega
Read in your language

omega-mcp

aien-dev/omega-mcp

Brought by drakestapleton

branch main Branches Tags History

omega-mcp / data / examples / files.om

39 lines · 896 bytes Raw Blame History
1note open, write, sync, lock, seek, read, positioned read and write, truncate, stat, chmod, unlink, memfd
2text path "demo.txt"
3global data uchar 5
4global buf uchar 128
5fn ck yes bool to void
6if not yes
7exit 80
8end
9end
10fn main to int
11for i ulong 5
12put data i uchar add 97 i
13end
14old = umask 18
15fd = int fopen path 0 len path 578 420
16ck ge fd 0
17ck eq write fd data 0 len data 5
18ck eq fsync fd 0
19ck eq fdsync fd 0
20ck eq flock fd 2 0
21ck eq syncfs fd 0
22ck eq pwrite fd data 0 1 5 1
23ck eq fseek fd 0 0 0
24ck eq read fd buf 0 6 6
25ck eq pread fd buf 0 2 3 2
26ck eq ftrunc fd 3 0
27ck eq fstat fd buf 0 128 0
28ck eq fchmod fd 384 0
29ck eq fclose fd 0
30ck eq stat path 0 len path buf 0 128 0
31ck eq lstat path 0 len path buf 0 128 0
32ck eq chmod path 0 len path 420 0
33ck eq faccess path 0 len path 4 0
34ck eq truncate path 0 len path 1 0
35ck eq unlink path 0 len path 0
36m = memfd path 0 len path 0
37ck ge m 0
38ret 0
39end