system

Description

Performs an operating system call and returns the resulting errorcode.

Syntax

number = system(string command)

ParameterDescription
command Operating system command to be executed.

Return Value

Returns the errorcode after execution of command.

Remarks

This function does not include or easily allow any sophisticated methods such as piping, signal handling, or interactivity.

Examples

The following example demonstrates a way to list a directory and then read the results.

system("ls"+" -l"+" > x.txt");
x=file.read("x.txt");
print(x);
file.unlink("x.txt");