Term Stream

Term streams are used to write/read to/from binary files to hold MINERVA user data for compact storage and fast input/output.

Binary term streams are opened with open/4 with the option type(term). After writing to a binary term stream it MUST be closed with an explicit call of close/1.

Predicates

There are 2 predicates to write and read terms in binary form:

Examples

        open('mydata.data',write,TermStream,[type(term)]),
        write_binary_term(TermStream, Term1),
                :
        write_binary_term(TermStream, TermN),
        close(TermStream),

        open('mydata.data',read,TermStream,[type(term)]),
	repeat,
        	read_binary_term(TermStream, Term),
	        ( Term = end_of_file ->
                        true
                ;       doSomeThingWith(Term),
                        fail
                ), !,
        close(TermStream),


read_binary_term/2
write_binary_term/2

Up read on...