next up previous contents index
Next: Practical examples of Up: Direct access input-output Previous: Direct access input-output

Main goals

General

The ZEBRA RZ package permits the storage and retrieval of ZEBRA data structures or Fortran vectors in random access files. Files may reside on standard direct access devices such as magnetic disk, or be mapped to virtual memory. RZ files can be accessed by several users simultaneously, even across networks. Remote file access and transfer is provided for RZ files using standard tools, such as NFS and ftp. In the heterogeneous environment, the tools provided in the CSPACK [2] package may be used.

The RZ package is not a relational database management system, but organises data in a hierarchical manner which is suitable for many applications in High Energy Physics, and probably outside.

Pathnames

The basic unit of information addressed in an RZ file is a ZEBRA data structure, in the simplest case a single ZEBRA bank. We call this an RZ data object. Each data object is referred to by a unique object name. Object names are composed of a pathname, and one or more identifiers known as keys.

The pathnames used by the RZ package were inspired by

the Unix file naming syntax and hence they typically carry mnemonic meanings and show the relationships between different objects. Unlike Unix, however, RZ pathnames are not case sensitive, i.e. upper and lower case are both treated as upper case.

As in the Unix file system, one may have directories and subdirectories seperated by slash characters ``/''. An interrelated set of objects may be grouped together in a directory.

When an RZ file is opened, a user specified name is associated with it. This name is known as the top directory and is not part of the file itself. This allows the user to have simultaneous access to multiple files with the same RZ directory structure.

At the very highest level in the RZ tree is the root, referred to by a double slash, `` //''.

The directory above a given subdirectory is known as the parent directory and may be referred to by a backslash character ``'' .

Two other concepts are also provided, namely the current working directory, or CWD and the naming directory. Objects are retrieved and stored relative to the current working directory. The naming directory is a mechanism for referring to a frequently used directory. It is initially set to the top directory, but may be reset at any time. The naming directory may be referred to by the symbol ``~''.

The following Fortran program provides examples of the above terms. For simplicity, the code to initialise the ZEBRA system and open the RZ files (via the routine RZOPEN) has been omitted.

Example of RZ pathnames and terms

*
*     Initialise RZ files on Fortran units LUN1, LUN2
*     with top directory names TOP1 and TOP2
*
      CALL RZFILE(LUN1,'TOP1',' ')
      CALL RZFILE(LUN2,'TOP2',' ')
*
*     Print the current naming directory
*     (It will have been set to TOP2 by RZFILE)
*
      CALL RZNDIR(' ','P')
*
*     Set the current working directory
*
      CALL RZCDIR('//TOP1/SUB1/SUB2/SUB3',' ')
*
*     Set the naming directory
*
      CALL RZNDIR('//TOP1/SUB1/SUB2/SUB3',' ')
*
*     Change directory relative to current working directory
*     (to parent directory in this case)
*
      CALL RZCDIR('\ ',' ')
*
*     Change directory to naming directory
*
      CALL RZCDIR('\~{}',' ')

Keys and Cycles

Data objects are identified beyond the pathname by keys, which may be a single word of information (integer, bit string or Hollerith) or a vector of such words. The keys are not part of the pathname itself.

For example, in the case of HBOOK histograms a single integer key, the histogram ID, may be used. Histograms relating to different information could be stored in separate subdirectories and referred to in a unique and clear manner by the associated pathname and key, e.g. //HISTOS/CUT1, keys (or IDs) 1--10.

Successive versions of objects with identical pathname/key combination may exist simultaneously. They are distinguished by a cycle number, which is incremented automatically upon creation of successive data objects. Cycles may be referred to explicitly, the usual default is the highest cycle number. The concept of cycles for successive versions of data objects with identical names was taken from the VAX/VMS file system.



next up previous contents index
Next: Practical examples of Up: Direct access input-output Previous: Direct access input-output


Janne Saarela
Mon May 15 08:34:47 METDST 1995