Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

sys

The sys module provides access to operating system level functionality: files, sockets, timers, and the netidx publish/subscribe system. All I/O goes through a unified Stream type defined in sys::io, so the same read/write functions work on files, TCP connections, TLS streams, and stdio.

ModulePurpose
sys::ioUnified Stream type, read/write/flush, stdin/stdout/stderr
sys::fsOpen files, directory operations, filesystem watching
sys::tcpTCP connect, listen, accept
sys::tlsUpgrade TCP streams to TLS
sys::netNetidx publish/subscribe and RPC
sys::timeTimers and current time
sys::dirsPlatform-aware standard directory paths
/// the command line arguments. argv[0] is the script file.
val args: fn() -> Array<string>;

/// join parts to path using the OS specific path separator
val join_path: fn(s: string, @args: [string, Array<string>]) -> string;