DuroDBMS API  1.7
Built-in I/O and system operators

These operators are only available in Duro D/T.

Package io

TYPE iostream_id POSSREP { id integer };


OPERATOR put_line(line string) UPDATES {};

Writes line to standard output, followed by a newline.

OPERATOR put(data string) UPDATES {};

OPERATOR put(data integer) UPDATES {};

OPERATOR put(data float) UPDATES {};

OPERATOR put(data boolean) UPDATES {};

OPERATOR put(data TUPLE { * }) UPDATES {};

OPERATOR put(data RELATION { * }) UPDATES {};

OPERATOR put(data ARRAY) UPDATES {};

Writes data to standard output.


OPERATOR get_line(line string) UPDATES {line};

Reads a line from standard input and stores it in line, without the trailing newline.


OPERATOR read(data binary, count integer) UPDATES {data};

Reads up to count bytes from standard input and stores it in data.


OPERATOR put_line(ios io.iostream_id, line string) UPDATES {};

Writes line to the I/O stream ios, followed by a newline.


OPERATOR put(ios io.iostream_id, data string) UPDATES {};

OPERATOR put(ios io.iostream_id, data binary) UPDATES {};

OPERATOR put(ios io.iostream_id, data integer) UPDATES {};

OPERATOR put(ios io.iostream_id, data float) UPDATES {};

OPERATOR put(ios io.iostream_id, data boolean) UPDATES {};

OPERATOR put(ios io.iostream_id, data TUPLE { * }) UPDATES {};

OPERATOR put(ios io.iostream_id, data RELATION { * }) UPDATES {};

OPERATOR put(ios io.iostream_id, data ARRAY) UPDATES {};

Writes data to the I/O stream ios.


OPERATOR get_line(ios io.iostream_id, line string) UPDATES {line};

Reads a line from I/O stream ios and stores it in line, without the trailing newline.


OPERATOR read(ios io.iostream_id, data binary, count integer) UPDATES {data};

Reads up to count bytes from @ ios and stores it in data.


OPERATOR open(ios io.iostream_id, path string, mode string) UPDATES {ios};

Opens file path in mode mode and stores the resulting I/O stream in ios.


OPERATOR close(ios io.iostream_id) UPDATES {};

Closes the I/O stream ios.


OPERATOR popen(ios io.iostream_id, command string, mode string) UPDATES {ios};

Spawns a process by running the command command and stores the resulting I/O stream in ios.


OPERATOR seek(ios io.iostream_id, pos integer) UPDATES {};

Sets the file position indicator for stream ios to pos.


OPERATOR eof() RETURNS boolean;

Returns TRUE if the end-of-file indicator was set while reading from standard input.


OPERATOR eof(ios io.iostream_id) RETURNS boolean;

Returns TRUE if the end-of-file indicator was set while reading from ios.


OPERATOR tmpfile() RETURNS io.iostream_id;

Opens a unique temporary file for reading and writing and returns an I/O stream. The file is automatically deleted when it is closed.


Package os

OPERATOR exit() UPDATES {};

OPERATOR exit(status int) UPDATES {};

Exits the current process.

If an integer argument is given it will become the status value returned to the parent.


OPERATOR system(command string, status int) UPDATES {status};

Executes command command.


OPERATOR getenv (name string) RETURNS string;

Description

Reads the environment variable name.

Return value

The value of the environment variable name.


OPERATOR chdir(path string) UPDATES {};

Changes the current direcory to path.


OPERATOR sleep(seconds integer) UPDATES {};

Suspends execution for the specified number of seconds.


Package net

OPERATOR form_to_tuple(tp TUPLE { * }, form_data string) UPDATES { tp };

Converts WWW form data to a tuple. For each name/value pair set the value of the corresponding tuple attribute to the value of the pair.