HPUX cdf[4]

cdf(4) cdf(4)
NAME
cdf - context dependent files
DESCRIPTION
A context dependent file (CDF) consists of several files grouped under
the same path name. The system ordinarily selects one of the files
using the context of the process (see context(5)). This mechanism
allows machine dependent executable, system data and device files to
work correctly from all nodes in a cluster while using the same path
name.
A CDF is implemented as a special kind of directory, marked by a bit
in its mode (see chmod(2)). The name of the CDF is the name of the
directory; the contents of the directory are files with names that are
expected to match one part of a process context. When such a
directory is encountered during a path name search, the names of the
files in the directory are compared with each string in the process's
context, in the order in which the strings appear in the context. The
first match is taken to be the desired file. The name of the
directory thus refers to one of the files within it, and the directory
itself is normally invisible to the user. Hence, the directory is
called a hidden directory.
When a process with a context that does not match any file names in
the hidden directory attempts to access a file by the path name of the
hidden directory, the reference is unresolved; no file with that path
name appears to exist. When such a process attempts to create a file
with the path name of the hidden directory, it creates within the
hidden directory a file whose name is the cnode name from the
process's context.
A hidden directory itself can be accessed explicitly, overriding the
normal selection according to context, by appending the character + to
the directory's file name.
EXAMPLES
Consider a cluster with three versions of /etc/inittab: one for cnode
william, one for cnode david, and a common file for the rest of the
cnodes. The contents of the hidden directory /etc/inittab, as shown
by the command:
ls -l /etc/inittab+
would then be:
-rwxr-xr-x`1`root`other`1416`Mar 7 10:08`david
-rwxr-xr-x`1`root`other`1211`Apr 12 11:16`default
-rwxr-xr-x`1`root`other`1037`Apr 3 12:04`william
The file names william and david match the cnode name in the context
of all processes on those cnodes. The file named default matches all
Hewlett-Packard Company - 1 - HP-UX Release 9.0: August 1992
cdf(4) cdf(4)
contexts if no other file in the hidden directory matches, and thus
matches the contexts of all processes on other cnodes. While a
default file may appear in a hidden directory, it is not necessary to
have one. If it did not exist in this case, nodes other than william
and david would not see any file named /etc/inittab.
If a user on the cnode william wants to find the difference between
the local cnode's /etc/inittab and the default version, any of the
commands:
diff /etc/inittab /etc/inittab+/default
diff /etc/inittab+/william /etc/inittab+/default
or
cd /etc/inittab+ ; diff william default
refer to the appropriate files.
A directory is changed to a hidden directory by using the chmod
command (see chmod(1)). In the above example, if /etc/inittab was an
ordinary directory,
chmod +H /etc/inittab
would be used to make it a hidden directory. Invoking:
chmod -H /etc/inittab+
makes /etc/inittab appear as a regular directory. Note that the +
must appear so that the mode will be changed for the hidden directory
itself.
A hidden directory can contain files of any type, including other CDF
s. Such use of nested CDFs is preferable to relying on the order of
items in the context for selecting files from a single hidden
directory. For example, in a cluster of HP 9000 Series 300
workstations, some of the workstations might have HP 98248A floating-
point accelerators, and one of those, with a cnode name of color,
might have a different graphics display. If
/usr/local/bin/graphicsprog is a floating-point-intensive application
that uses the local graphics display, it might be useful to have three
versions built, each for the appropriate hardware configurations. The
arrangement of the three versions, as shown by the command:
ls -lRH /usr/local/bin/graphicsprog+
might then be:
Hewlett-Packard Company - 2 - HP-UX Release 9.0: August 1992
cdf(4) cdf(4)
total 202 dr-sr-xr-x`2`bin`bin`1024`Feb 26 17:34`HP98248A+ -r-
xr-xr-x`1`bin`bin`101144`Feb 26 17:31`default
graphicsprog+/HP98248A+: total 414 -r-xr-xr-
x`1`bin`bin`105112`Feb 26 17:34`color -r-xr-xr-
x`1`bin`bin`103732`Feb 26 17:40`default
AUTHOR
cdf was developed by HP.
SEE ALSO
chmod(1), find(1), getcontext(1), ls(1), pwd(1), showcdf(1), tar(1).
makecdf(1M), chmod(2), getcontext(2), getcdf(3C), context(5),
Hewlett-Packard Company - 3 - HP-UX Release 9.0: August 1992