read_binary_term/2

read a term "Term" from a binary term stream "TermStream"

read_binary_term(+TermStream, -Term)

read a term from a binary term stream. At end of file, the predicate returns 'end_of_file'.

Arguments

	TermStream	Stream, opened with open/4 option type(term)
			the data must be binary term data
	Term		a term

Example

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

Standard

This predicate is not part of the ISO-Prolog Standard.

See also

binary term streams, write_binary_term/2,


Up read on...