sys.eh

Various system functions More...

use "sys.eh"

Functions

def acopy(src: Array, sofs: Int, dest: Array, dofs: Int, len: Int);
def bacopy(src: BArray, sofs: Int, dest: BArray, dofs: Int, len: Int);
def cacopy(src: CArray, sofs: Int, dest: CArray, dofs: Int, len: Int);
def exec(prog: String, args: [String]);
def exec_wait(prog: String, args: [String]): Int;
def getenv(key: String): String;
def setenv(key: String, val: String);
def sleep(millis: Int);
def Structure.clone(): Structure;

Description

This header contains various functions which do not fit in other headers.

Function details

def getenv(key: String): String;
Returns value of environment variable with given name. If variable is not defined then empty string "" is returned.

def setenv(key: String, val: String);
Sets new value to the environment variable with given name.

def sleep(millis: Int);
Causes process to sleep for the specified number of milliseconds.

def exec_wait(prog: String, args: [String]): Int;
Executes given command with given arguments as subprocess of this process. This function blocks until subprocess executes and returns exit code of that subprocess.

def exec(prog: String, args: [String]);
Executes given command with given arguments as subprocess of this process in separate thread. This function returns immediately after subprocess starts and its result are two processes running consequently.

def acopy(src: Array, sofs: Int, dest: Array, dofs: Int, len: Int);
Copies len elements from array src starting at index sofs to array dest starting at index dofs.

def bacopy(src: BArray, sofs: Int, dest: BArray, dofs: Int, len: Int);
Copies len elements from array src starting at index sofs to array dest starting at index dofs.

def cacopy(src: CArray, sofs: Int, dest: CArray, dofs: Int, len: Int);
Copies len elements from array src starting at index sofs to array dest starting at index dofs.

def Structure.clone(): Structure;
Clones structure. The returned value is new structure of the same type with all fields copied from the old structure.