1 Introduction

This document describes how to connect Mozart applications to the rest of the computational world. Sometimes this is paraphrased as interoperability.

Interoperability is supported in Mozart by the modules Open and OS. The module Open provides the following classes:

  1. The class Open.file for reading and writing files.

  2. The class Open.socket for sending and receiving data over the Internet.

  3. The class Open.pipe to create operating system processes and to communicate with them.

  4. The class Open.text for reading and writing texts character by character or line by line. This class can be combined with any of the classes from above.

Each of these classes is described by a chapter on its own (Chapter 3, Chapter 5, Chapter 6, and Chapter 4). The chapters explain the basic concepts to use the classes and contain a small example. Reference information to the classes can be found as usual in the document Chapter 20 of ``System Modules''.

The module OS provides procedures for random numbers, for manipulating files, directories, sockets, and the like. The module makes functionality found in the operating system available within Oz. Since Oz runs both on Unix based and Windows based platforms, the functionality provided is limited to what is defined by the POSIX.1 Standard [IEE90]. Its documentation can be found in Chapter 21 of ``System Modules''.

It is important to understand the data structures needed for reading, writing, and sending. For this reason Chapter 2 discusses these data structures in some detail.

1.1 Local Computation Spaces

There is very little to say about local computation spaces and input/output:

Danger

input and output do not work in local computation spaces!

1.2 Conventions

Throughout this document we refer to Unix manual pages for further information. For example, open(2) means that you should look up the manual page with title ``open'' in Section 2. Type man 2 open1 to your Unix shell to see the manual page. In case you are running a Windows based system, information can be found in a good Unix book or a book describing the POSIX.1 standard (e. g., [Lew91]).

1.3 The Examples

This document contains quite a number of examples. It is recommended to read this document and try the examples while reading. All the examples collected into a single file can be found here.


1. On some systems you have to type man -s 2 open instead.

Christian Schulte
Version 1.4.0 (20080702)