Skip to main content

5. Opening and closing containers

Containers must be open before they can be operated on.

A container is open when it is first created. It remains open until closed explicitly by a CLOSE-request or implicitly by a DELETE-request or by session end.

A closed container is opened by an OPEN-request. A temporary container is always open; a CLOSE-request deletes it.

5.1 Modes​

An open container has a mode, which is one of: READ, WRITE, or APPEND. The mode determines the meaning and/or legitimacy of certain operations on the container.

The mode is established by the operation which opens the container. It can be changed at any time by a MODE-request. A CREATE leaves the container in WRITE mode. An OPEN either specifies the mode explicitly or implicitly sets the mode to READ.

5.2 Syntax​

To open a container:

OPEN <pathname> <mode> ;

or:

OPEN <pathname> ;

where <mode> is defaulted to READ.

To close a container:

CLOSE <ident> ;

where <ident> is the name of an outermost container.

Two containers with the same outermost <ident> can not be opened at the same time (***).

To change the mode of an open container:

MODE <ident> <newmode> ;

5.3 LIST​

LIST %OPEN transmits name, mode and connection status of each open outermost container through the Datalanguage output port. (The Datalanguage output port is the destination to which all Datacomputer diagnostics and replies are sent. It is established when the user initially connects to the Datacomputer.) For details of the LIST-request, see section 10.1.