[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.9 STD:Stream

A stream is a data source or destination. It is usually a file, can also be a Unix pipe (such as standard output or standard error) or (in future versions) could be a network socket. Consecutive reads from the same stream pick up where the last one left off.

In Bunao, there is no need to close a stream. All streams are closed implicitly when the program terminates. There is nothing preventing you from re-opening a stream, however.

The STD:Stream module opens a stream from a while and associates it with a name (often called the stream's handle). After a stream is opened, modules like STD:Print (see section STD:Print) can use its handle to direct their output. A stream is opened either for reading or writing. STD:Print uses write streams. A read stream can be used in modules like STD:Read Raw (see section STD:Read Raw).

Use Name to specify the name of the stream, and File to enter the name of the file the stream refers to. Use the Open file for radiobuttons to specify reading or writing.

Warning: a stream opened for writing will silently replace the contents of any existing file.

STD:Stream user interface:

images/std-stream

STD:Stream attribute list:
Attribute Type Default Description
name string (blank) name (handle) of the new stream
file file name (blank) file to open
type r
w
r read or write stream



This document was generated on October, 28 2005 using texi2html