O Language

System APIs

Use O Language functions for files, processes, environment values, sockets, HTTP and databases.

O Language pagesSystem APIs
On this page

O Language exposes host and service operations through runtime values and built-in functions. These calls run in the process environment; the interpreter does not sandbox file access or commands.

Files and environment

File and directory helpers include read, write, remove, mkdir, rmdir, finfo, chmod, exist, wdir and chdir. Use sysenv to read or set process environment values.

Paths are interpreted by the host process. Check the current working directory before loading files or writing output. File helpers return values that can indicate failure; see the built-in reference.

Processes

The runtime can start commands with open, exec, sh_exec, cmd_exec and run. Process values can be inspected with proc_out and proc_pid, or stopped with proc_kill.

A shell command passed to sh_exec is executable shell input. Review it before running a source file or project job. The process file guide explains the separate proc.ops launcher.

Sockets and HTTP

Socket helpers include sock, sock_send and sock_listen. The listener blocks while it serves requests. The built-in HTTP server uses webserver(port, routes); see Web programming and Routing.

Databases and data formats

The database functions include database, model, migrate, fetch, create, update, delete, drop, truncate, query and search. The json, jsonp, jsonf, xmlp and xmlf helpers read and convert data.

Function signatures and backend limits are listed in the built-in API reference. For a working database flow, see Database access.

Host access and trust

File writes modify the current filesystem. Process functions execute host commands, socket functions can listen on network ports, and web routes may accept uploads. Use only source you have reviewed and choose a network binding and database path intentionally.