System Programming with `system`

Low-level/mid-level runtime operations for system tooling and automation, with dedicated `fileio` and `lowlevel` companion modules.

Capabilities

Thread metadata, filesystem operations, environment variables, wall-clock timing, and child process execution.

For explicit file-centric APIs and bitwise/byte helpers, see `fileio::*` and `lowlevel::*` in DB + File I/O + Low-Level.

Core APIs

system::threads()
system::compileJobs()
system::cwd()
system::exists(path)
system::isFile(path)
system::isDir(path)
system::readText(path)
system::writeText(path, content)
system::appendText(path, content)
system::mkdir(path)
system::rename(oldPath, newPath)
system::removeFile(path)
system::removeDir(path)
system::envGet(key)
system::envSet(key, value)
system::nowMillis()
system::sleepMs(ms)
system::exec(command, args)

Example

import system

system::mkdir("tmp")
system::writeText("tmp/log.txt", "started\n")
var proc = system::exec("echo", ["hello"])
display proc[0]  // exit code
display proc[1]  // stdout
system::removeDir("tmp")