Theory of Operation

When a viewpath is specified, by means of the environment variable NVPATH, the tools treat all input filenames as viewpath-relative. To create a viewpath-relative filename, the tools first determine the difference between the first element of the NVPATH variable and the current working directory. For example, if NVPATH=/1:/2:/3 and your current working directory is /1/subdir/, then the difference is subdir/.

This difference is appended to each node in the viewpath, in order to generate the path prefix to append to the relative filename provided to the tool. In the previous example, if the tool is given src/file.c, then the searched locations will be, in order:

/1/subdir/src/file.c

/2/subdir/src/file.c

/3/subdir/src/file.c

For effective viewpathing, the developer must run all tools from a current working directory which is a subdirectory of the first element in the NVPATH, referred to as the root node.

Undesirable behavior may result if "." is specified as the root node.

Viewpathing does not affect the locations of output files. All temporary files will be unaffected and all other output files (such as executables, object files, etc.) will be created relative to the root node.

If a file located in a directory down the viewpath, for example, in the 2nd or 3rd node, is opened for modification, such as adding files to an archive or editing a text file, then the original file will first be copied into a location relative to the root node. Then, it will be opened for modification. In this way, a developer's modification will not affect the development group's files.


Previous

Next



Copyright © 1999, Green Hills Software. All rights reserved.