Term streams are used to write/read to/from binary files...
Move to
Next Prev
Up Top
Zoom to
read_binary_term/2
write_binary_term/2
See also
Arithmetic comparison
Arithmetic evaluation
Atomic term processing
Text Processing and Regular Expressions
Blackboards
BinaryIO
Character input/output
Constraints
Compilation
Clause creation and destruction
Clause retrieval and information
global variables
Grammar rules
Lists
Logic and control
All Solutions
Communication between distributed Minerva processes.
Stream selection and control
Servlet
Term comparison
Term creation and decomposition
Term input/output
Term unification
Term vector
Term Stream
XML (eXtended Markup Language) terms
Asynchronous timer handling
Type testing
IF Computer > MINERVA > Manual > Reference > Predicates > Term Stream

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:
  • write_binary_term(+TermStream, +Term)
    writes a term to a TermStream
  • read_binary_term(+TermStream, -Term) reads a term from a TermStream
    at end of file, returns end_of_file

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 on...
read_binary_term/2
read a term "Term" from a binary term stream "TermStream"...
write_binary_term/2
write a term "Term" to a binary term stream "TermStream"...
MINERVA
ifcomputer logo
f
Expert Services on the Web
Language
English
Japanese
Server
USA
Japan
Site Access
Local Index
Local Contents
Site Contents
Site Index
Printer Friendly
For imode
For PDA
Search
document: http://www.ifcomputer.co.jp/MINERVA/Manual/Reference/Predicates/TermStream/home_en.html
published 2008/11/17 update 2002/3/20 (c) 1996-2006 IF Computer Japan
IF Computer 5-28-2 Sendagi, Bunkyo-ku Tel +81-3-5814-3352 start (AT) ifcomputer.com
Customer Support Tokyo 113-0022 Japan   http://www.ifcomputer.com
scroll to top managed with ubiCMS