|
4.8.5.1 MPfile links
MPfile links provide the possibility to store data in a file using the
binary MP format. Read and write operations are very fast compared to
ASCII links. Therefore, for storing large amounts of data, MPfile links
should be used instead of ASCII links. Unlike ASCII links, data read
from MPfile links is returned as expressions one at a time, and not as a
string containing the entire content of the file. Furthermore, ring-dependent
data is stored together with a ring description. Therefore,
reading ring-dependent data might change the current ring.
The MPfile link describing string has to be one of the following:
"MPfile: " + filename
the mode (read or append) is set by the first read or
write command.
"MPfile:r " + filename
opens the file for reading.
"MPfile:w " + filename
opens the file for overwriting.
"MPfile:a " + filename
opens the file for appending.
There are the following default values:
- if none of
r , w , or a is specified, the mode of
the link is set by the first read or write command on the
link. If the first command is write , the mode is set to a
(append mode).
Note that the filename may contain a path. An MPfile link can be used
either for reading or for writing, but not for both at the same time. A
close command must be used before a change of I/O direction.
Example:
|