Up | Previous | Next | Title Page | Contents

3.1 Introduction

This Section describes the image I/O to be used with the MIPL VICAR image processing executive.

Note that a x/zvread or x/zwrite operation, without specifying the location (line/sample/band), automatically reads the "next" record. In BSQ this is the next line. See 3.2.6 x/zvread—Read a line) for more information.

3.1.1 Unix filename expansion

Under Unix, filenames accepted by the RTL (via x/zvunit), either the U_NAME optional or the INP or OUT parameters) now can contain environment variables and usernames. A reference of the form $var will be replaced with the value of the environment variable var. The name of the environment variable (but not the dollar sign) may optionally be enclosed in curly braces (${ var}). A tilde (~) followed by a username will be replaced with the home directory of that user. A tilde without a username will be replaced with the home directory of the current account. Both of these expansions exactly mimic the behavior of the C-shell, so they should be familiar to most Unix users.

3.1.2 Temporary files

Filenames that begin with a plus sign (+) are treated as temporary files in both Unix and VMS. The old VMS VICAR style of specifying temporary filenames was to leave off the filename extension, which was replaced with a .Z xx extension (where xx is based on the process ID). This approach still works under VMS, but it is not supported under Unix. A Unix filename can have no extension and still be perfectly legal. Plus, it is infeasible to search all the user's directories to delete temporary files when the user logs off (which is what happens under VMS).
Instead of scattering temporary files all over the place (distinguised by their name), the new style is to collect them all in one directory. Prepending a plus sign (+) to the name tells the VICAR RTL to put the files in the temporary directory. This directory is pointed at by the $VTMP environment variable in Unix, and the VTMP: rooted logical name in VMS. VTMP is set up by vicset2 for both systems (it normally points at /tmp/ username for Unix and a scratch directory for VMS). Because VTMP: is a rooted directory, accessing the top-level directory outside of VICAR is a little more difficult; you must use “vtmp:[000000]”.
Subdirectories of VTMP are allowed. Under Unix, they look like “+sub/dir/file”, while under VMS, they look like “+[sub.dir]file”. The subdirectories are not automatically created; use “mkdir $VTMP/sub/dir” under Unix and “cre/dir vtmp:[sub.dir]” under VMS. Because of these differences, the use of subdirectories is not portable between systems.
Currently, all processes using the same login id share the same temporary directory. This may be changed in the future so concurrent independent jobs will have separate directories. In the meantime, a workaound is to redefine VTMP to use a process-specific directory name.

3.1.3 Filename Expansions

Any time the RTL accepts a filename (x/zvunit or x/zvfilename), there
are a number of expansions that can occur, most of which will be familiar to
C-shell programmers. Also, a special syntax for temporary files has been
provided.
For UNIX, the expansions are as follows:
For VMS, the expansions are as follows:
Under VMS, both expansions may occur on the same name.

The temporary filename locations ( $VTMP and vtmp) are set up in vicset2.


Up | Previous | Next | Title Page | Contents