Top
Back: MP links
Forward: MPtcp links
FastBack: ASCII links
FastForward: Ssi links
Up: MP links
Top: Singular Manual
Contents: Table of Contents
Index: Index
About: About this document

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:

  1. "MPfile: " + filename
    the mode (read or append) is set by the first read or write command.
  2. "MPfile:r " + filename
    opens the file for reading.
  3. "MPfile:w " + filename
    opens the file for overwriting.
  4. "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:
 


Top Back: MP links Forward: MPtcp links FastBack: ASCII links FastForward: Ssi links Up: MP links Top: Singular Manual Contents: Table of Contents Index: Index About: About this document
            User manual for Singular version 3-1-6, Dec 2012, generated by texi2html.