VOS functions
The VOS (Virtual Operating System) library isolates all system-dependent code.
According to Ockham's razor, only a limited number of useful functions have been
selected.
VOS routines (whose name begins with Z_) have the same calling interface on all systems, but are written :
- on VMS
Top level routines are written in Fortran
Most of them call directly VMS system or library services, or call auxiliary
routines doing this. Auxiliary routines are located usually within the same
source file (to be hidden to users). Very few top levels routine call a
Fortran-callable C-wrapper which calls the system in C.
- on Unix
Top level routines are written in Fortran
Most of them however call a Fortran-callable C-wrapper which makes
system or library calls in C, and takes care of all adaptations (conversion
of arguments, linking routines not Fortran-callable, ...). However a few
top level routines are entirely in Fortran.
List of functionalities
File access
- Open a file (replaces Fortran OPEN)
- Return file information (replaces/extends Fortran INQUIRE)
- Convert "vos" file names to system dependent file names
- Convert Fortran error codes to system independent values
- Delete a file
- Rename a file
The goal is to allow all i/o to be done using normal Fortran READ and
WRITE statements, using only two forms of file access (ASCII stream_lf
sequential and binary direct access). Also since file names may be encoded
within the program, a system-independent naming ("vos" naming, actually very
close to Unix /dir/dir/name.type form) is used.
- Environment access
- Get the program command string (arguments)
Any command is invoked as prog arg1 arg2 ... argn. Further use of
arguments (as well as substituting them with interactive or file input) is
handled by higher level "user interface" routines.
- Return or set the value of a global variable
A global variable is used as a way to pass information from the shell to
a program and viceversa (and so also across consecutive programs). Global
variables are implemented as VMS global symbols, or Unix environment variables
(plus a trick for import-back).
- Terminate a program passing back a status code
- Miscellaneous utilities
- Allocate and deallocate memory
- Detect an interrupt (ctl-C)
- Convert REAL and DOUBLE floating data (IEEE to/from VMS)
- Miscellaneous queries
- Return the current operating system
- Return the name of the host
- Return current terminal device name and size (rows and columns)
- Return current user name (account and also full name)
- Return time current login session started
- Return current system time
- Inter-process operations
- Run a program (concatenate to current process)
The usual way to implement command chains, or front-end command wrappers,
is to terminate a program chaining to another one (this means in VMS term
activating another image in the same process, and in Unix terms to overlay
the current process with another executable)
- Spawn a program (create another process)
A seldom used case (mainly to start server programs) is to activate a
separate process (sub-process for VMS) which then runs independently
- Create, open, test a communication channel among two programs
- Open, close, read and write on a communication channel
Communication between independent clients and servers occurs through a
channel. Channels are implemented in VMS as mailboxes and in Unix as
named pipes
I/O across a channel is implemented wherever possible using Fortran
sequential unformatted i/o, otherwise using C routines.
sax.iasf-milano.inaf.it/Sax/Xas/vos.html
:: original creation 1996 Oct 15 19:16:06 CEST ::
last edit 1996 Oct 15 19:16:06 CEST