The StreamFile box must be attached to a file via its pathname. It has one input and one output :
| ![]() |
The properties of the StreamFile can be edited if needed.
To open the StreamFIle properties
window, double click on the box.
Read / Write
, Write
, Read
. File Type
pop up menu offers two file formats : text or SDIF. The File Exists
pop up menu offers four options, which apply to an existing targeted file.
Each of these four options determine the way the program behaves when the text file is open or created to access its contents.
This behaviour results from the position of the pointer and the choice of a destructive or non destructive action.
The file-write function writes something in a file. It has two inputs and one output:
| ![]() |
The file-write-line function is similar to file-write, but adds a line return at the end of the input data.
To add several lines at the end of the file, an iterative process must be introduced in the program. Most of the time, each iteration triggers one operation in the File-Box loop.
The file-read-line function allows to read one line in a file. It has one input and one output :
When all the lines of the text are exhausted, file-read-line returns "nil". Lines can be read one by one. | ![]() |
Most of the time, each iteration triggers one operation. In this case, the successive lines can be stored with an accumulator such as collect, as in an OMLoop.
"Eof" stands for "end of file", "p" for "predicate". The file-eof-p function is a predicate, which allows to read a whole file whose number of lines is unknown. This function tests if a streamfile is at the end of the file. It has one input and one output :
It can be associated with whileloop and OMIF, which execute a specific operation when the end of the file has been reached. | ![]() As long as the predicate finds no streamfile, it returns "nil", and lines are collected. |