O Language/API/System
From OnixOS
System APIs
System APIs connect O Language programs to the operating system and external services.
Files and environment
Use read, write, remove, mkdir, rmdir, finfo, chmod, exist, wdir, and chdir for files and directories. Use sysenv to read environment values.
Processes
Use open, run, exec, sh_exec, and cmd_exec to start commands. Use proc_out, proc_pid, and proc_kill to inspect or stop them.
Sockets
sock socket "tcp4" "9050" "0.0.0.0"
sock_send(socket, "ping")
sock_listen(socket, {"ping": "pong"})
sock_listen dispatches messages from a hash and sock_send sends a message through an open socket.
HTTP
webserver(port, routes) starts an HTTP server. See Web Programming for route and request examples.
Database
The database API includes database, model, migrate, fetch, create, update, delete, drop, truncate, query, and search. See Database for a complete example.
