pathnames_ccase

Pathname resolution, dynamic view context, and extended namespace

APPLICABILITY


Product

Command Type

ClearCase


general information


ClearCase LT


general information


Platform

UNIX


Windows

SYNOPSIS

DESCRIPTION

This reference page describes ClearCase and ClearCase LT extensions to the standard file/directory namespace provided by the operating system. These extensions can be used as follows:

NOTE TO WINDOWS USERS: cleartool is case-sensitive. In cleartool subcommands, pathnames to MVFS objects, including view-private files in the MVFS namespace, must be case-correct. Also see the cleartool reference page for information on restrictions on object names.

DYNAMIC VIEW CONTEXTS

A pathname can access ClearCase or ClearCase LT data only if it has a view context:

WINDOWS ONLY-DYNAMIC VIEW ACCESS MODEL

All ClearCase data is accessed through the MVFS, which, by default, occupies drive M: on each ClearCase host. Each active view's view-tag appears in the root directory of M:, and each active VOB's VOB-tag appears as a subdirectory under each active view.

From the M: drive, you can access VOBs using view-specific pathnames of the form \view-tag\vob-tag\pname-in-vob. Typically, however, you do not work directly on the M: drive, but on a drive you have assigned to a view.

From any drive, you can specify view-extended pathnames of the form M:\viewtag\vobtag\rest-of-path. If you move to the M: drive, you are in view-extended namespace, and all VOB access is via view-extended pathnames.

To eliminate any confusion that may result from unintentional use of view-extended pathnames, we recommend that you work from a drive letter assigned to a view. This permits you to use VOB pathnames of the form \myvob\vob-object-pname in both cleartool and standard operating system commands, from any view. Furthermore, this approach is required if you want to share DOs between views at build time.

KINDS OF PATHNAMES

The following sections describe the kinds of pathnames you can use with ClearCase and ClearCase LT.

NOTE: In the UNIX examples that follow, arguments and output that show multicomponent VOB tags are not applicable to ClearCase LT, which recognizes only single-component VOB tags. In this manual, a multicomponent VOB tag is by convention a two-component VOB tag of the form /vobs/vob-tag-leaf-for example, /vobs/src. A single-component VOB tag consists of a leaf only-for example, /src. In all other respects, the examples are valid for ClearCase LT.

UNIX Only-Standard Pathnames

A standard pathname is either full or relative:

A relative pathname is interpreted in the process's working directory view context, if it has one. Otherwise, it uses the process's set view context. If a process has neither kind of view context, an error occurs.

A standard pathname can reference any kind of file system object: For example, /vobs/proj/BAR references "file-system object named 'BAR', as seen through the current view." This can be any of the following:

Using standard pathnames to reference MVFS objects is termed transparency: a view's view_server process resolves the standard pathname into a reference to the appropriate MVFS object. In essence, transparency makes a VOB appear to be a standard directory tree.

Windows Only-Standard Pathnames

A standard pathname is either full or relative:

A standard pathname can reference any kind of file system object. Typically, you use the net use command or click Tools  > Map Network Drive in Windows Explorer to set a working view (myview, for example), and then work from the drive assigned to M:\myview. In this case, a pathname like \vob1\proj\bar references "file system object named bar, as seen through the current view." The referenced object can be any of the following:

Using standard pathnames to reference MVFS objects is termed transparency: a view's view_server process resolves the standard pathname into a reference to the appropriate MVFS object. In essence, transparency makes a VOB appear to be a standard directory tree.

NOTE: Most ClearCase and ClearCase LT utilities, including cleartool, accept a slash (/) or backslash (\) as pathname separators. That is, the following pathnames, when used as arguments to ClearCase or ClearCase LT programs, are equivalent:

Z:\myvob\src\test.h
Z:/myvob/src/text.h

Windows Only-Absolute VOB Pathnames

An absolute VOB pathname is full pathname that starts with a VOB-tag.

Z:\myvob\src\main.c (full pathname to VOB object-Z: drive assigned to some view)

\myvob\src\main.c (absolute VOB pathname- begins with a VOB-tag (\myvob)

Absolute VOB pathnames are legal only if the current drive is assigned to a view. (Manually attaching a drive letter to M:\view-tag with the subst command also enables absolute VOB pathnames.) This form of pathname is commonly used in config specs (see config_spec), and it is also the form in which configurations records store references to MVFS objects.

Extended Pathnames

The MVFS supports two kinds of extensions to the standard pathname scheme:

Windows:

foo.c@@\main\12 (version-extended pathname)

\proj_vob\foo.c@@\main\bugfix\4 (version-extended pathname)

foo.c@@\RLS4.3 (version-extended pathname)

foo.c@@\main (VOB-extended pathname to a branch)

foo.c@@ (VOB-extended pathname to an element)

hello.o@@15-Sep.08:10.439 (VOB-extended pathname to a derived object)

VIEW-EXTENDED PATHNAMES

On UNIX systems, a view-extended pathname is a standard pathname, along with a specification of a view. For example, /view/david/vobs/proj/BAR references file-system object named BAR, as seen through view david.A view-extended pathname can access any kind of file-system object, as described in UNIX Only-Standard Pathnames.

On Windows systems, a view-extended pathname is a standard pathname that references a VOB object or view-private object via a specific view. For example, M:\dri_view\proj_vob\BAR references file-system object named BAR, as seen through view dri_view. A view-extended pathname can access any kind of file-system object, as described in UNIX Only-Standard Pathnames.

NOTE TO WINDOWS USERS: In general, you perform ClearCase and ClearCase LT operations in a view, on a drive assigned to a view with the net use command. It is rare to work directly on drive M:. It is common to use view-extended pathnames that include the M:\view-tag prefix. If you work directly on M:, you are in view-extended namespace.

UNIX Only-The Viewroot Directory / View-Tags

In most view-extended pathnames, a full pathname is prepended with two components: the name of the host's viewroot directory and the view-tag of a particular view. The viewroot directory is a virtual data structure, whose contents exist only in MVFS buffers in main memory. Each view is made accessible to standard programs and ClearCase programs through a view-tag entry in the viewroot directory. No standard command or program can modify this directory. Only a few ClearCase commands use or modify it: mkview, mktag, rmtag, rmview, startview.

The viewroot directory is activated by a standard mount(1M) command, which considers the virtual data structure to be a file system of type MVFS. The ClearCase pathname of the viewroot directory is /view. See the init_ccase reference page and the Administrator's Guide for details.

Windows Only-The MVFS Directory / View-Tags

Most view-extended pathnames are full pathnames that begin with the view-tag of a particular view. Unless you are working explicitly on M:, the view-extended pathname also includes the M: prefix. Each view is made accessible to standard programs and ClearCase programs through a view-tag entry on the dynamic-views drive, M:. No standard command or program can modify the dynamic-views drive's root directory. Only a few ClearCase commands use or modify it: mkview, mktag, rmtag, rmview, startview.

SYMBOLIC LINKS AND THE VIEW-EXTENDED NAMESPACE

Pathnames are resolved component-by-component by the operating system kernel and the MVFS. When a UNIX symbolic link or VOB symbolic link is traversed, a full pathname needs a UNIX set view context or a Windows view context to access ClearCase data. Thus, a symbolic link whose text is a full UNIX pathname such as

/vobs/aardvark -> /vobs/all_projects/aardvark ...

or a Windows absolute VOB pathname such as

\aardvark -> \all_projects\aardvark

is interpreted in the current UNIX set view context or Windows view context. If the process has no context, traversing such a symbolic link will fail.

VOB-EXTENDED PATHNAMES

The transparency feature enables you to use standard pathnames to access version-controlled data; the view_server does the work of locating the data. But you can also bypass transparency and do the work yourself:

The pathnames in the above examples are termed VOB-extended pathnames. A VOB's file/directory namespace is extended in two ways from the standard namespace: one extension enables direct access to elements, branches, and versions; the other enables direct access to derived objects. Both extensions allow you to access objects not visible in your own view (and perhaps not currently visible in any other view, either).

Extended Namespace for Elements, Branches, and Versions

An element's version tree has the same form as a standard directory tree.


Component of Version Tree

Component of Directory Tree in Extended Namespace

element


Root of tree: The element itself appears to be a directory, which contains a single subdirectory, corresponding to the main branch. (It can also contain some version label; see Version Labels in Extended Namespace.)


branch


Subdirectory: Each branch appears to be a directory, which contains files (individual versions and version labels), directories (subbranches), and links (version labels).


version


Leaf name: Each version appears to be a leaf of a directory tree. For a file element, the leaf contains text lines or binary data. For a directory element, the leaf contains a directory structure.

Accordingly, any location within an element's version tree can be identified by a pathname in this extended namespace:

sort.c@@

(specifies an element)

sort.c@@/main

(specifies a branch)

sort.c@@/main/branch1

(specifies a branch)

sort.c@@/main/branch1/2

(specifies a version)

doctn/.@@/main/3

(special case: extra component is required in VOB's top-level directory)

Extended Naming Symbol

The previous pathname examples incorporate the extended naming symbol (@@). This symbol is required to effect a switch from the standard file/directory namespace to the extended element/branch/version namespace. There are two equivalent ways to think of @@

NOTE: The establishment of @@ as the extended naming symbol occurs at system startup time with a file system table entry. Thus, different symbols may be used on different hosts. See the init_ccase reference page for details.

Version Labels in Extended Namespace

Version labels appear in the extended namespace as hard links (UNIX) or as additional files (Windows).

In UNIX, if version /main/4 of an element is labeled RLS_1, the extended namespace directory corresponding to the element's main branch lists both 4 and RLS_1 as hard links to the version:

ls -il sort.c@@/main
246 -r--r--r-- 1 drp user 217 Oct 6 21:12 4
.
.
.
246 -r--r--r-- 1 drp user 217 Oct 6 21:12 RLS_1

In Windows, if version \main\4 of an element is labeled RLS_1, the extended namespace directory corresponding to the element's main branch lists both 4 and RLS_1:

Z:\myvob\src> dir sort.c@@\main
11/10/98 05:34p                1846 4
 ...
11/10/98 05:34p                1846 RLS_1

If the label type was created with the once-per-element restriction, an additional UNIX hard link to the labelled version the labeled version appears in the element's top-level directory:

ls -il sort.c@@
246 -r--r--r-- 1 drp user 217 Oct 6 21:12 RLS_1

or a Windows entry for the labeled version appears in the element's top-level directory:

Z:\myvob\src> dir sort.c@@
11/10/98 05:34p                1846 RLS_1

In this case, all the following are equivalent extended pathnames to the labeled version:

UNIX:

sort.c@@/RLS_1 (version label at top level of element)
sort.c@@/main/4 (version-ID)
sort.c@@/main/RLS_1 (version label at branch level)

Windows:

sort.c@@\RLS_1 (version label at top level of element)
sort.c@@\main\4 (version-ID)
sort.c@@\main\RLS_1 (version label at branch level)

(The once-per-element restriction is the mklbtype default. A mklbtype -pbranch command creates a label type that can be used once on each branch of an element.)

Pathnames Involving More Than One Element

A VOB can implement a deep directory structure. Thus, a pathname can involve several elements. For example:

/vobs/proj/src/include/sort.h

If proj or proj_vob is the VOB's root directory element, then src and include also name directory elements, and sort.h names a file element.

After a pathname crosses over into the extended namespace with @@, you must specify a version for each succeeding element in the pathname. For example:

To automatically select versions for elements proj and src: cross over to extended namespace at directory element include, specifying a version of include and a version of sort.h:

To automatically select versions for element proj only: cross over to extended namespace at directory element src, specifying the version labeled RLS_1 of each succeeding element:

SPECIAL CASE: When crossing over into extended namespace at the VOB root directory (that is, at the VOB-tag or VOB mount point), you must use /.@@ or \.@@ instead of @@.

The extended naming symbol need be used only once in a pathname, to indicate the crossover into extended namespace. You can, however, append it to any element name:

Reading and Writing in the Extended Namespace

A VOB-extended pathname references an object in a VOB database. The reference can either read or write the database-that is, either query metadata or modify metadata:

For a version, an extended pathname can also read the version's data, but cannot write or delete it:

Extended Namespace for Derived Objects

The extended namespace allows multiple derived objects to exist at the same standard pathname. Multiple versions of an element also exist at the same standard pathname, but the two extensions work differently. Derived objects created at the same location are distinguished by their unique derived object identifiers, or DO-IDs:

sort.obj@@14-Sep.09:54.418
sort.obj@@13-Sep.09:30.404
sort.obj@@02-Sep.16:23.353
.
.
.

An extended name provides access only to the derived object's metadata in the VOB database-principally, its configuration record. DO-IDs can be used only with ClearCase commands; they cannot be used in non-ClearCase programs (for example, editors or compilers).

Navigating the VOB-Extended Namespace

You can use the operating systems directory-navigation commands in a VOB's extended namespace. For example, these are two equivalent ways to display the contents of an old version:

In VOB-extended namespace, elements and branches are directories; you can change to such directories with cd; you can lists their contents-branches and versions-with operating system commands.

You can access versions of file elements as ordinary files with operating system commands-even executing versions that happen to be compiled programs or scripts.

UNIX ONLY-SPECIAL VIEW-TAG REPORTED BY PWD. When you have changed to a VOB-extended namespace directory, the pwd(1) command reports your current working directory as under a special view-tag: For example:

cd /view/akp_vu/vobs/proj/special@@

pwd
/view/akp_vu@@/vobs/proj/main/4/special

The special view-tag akp_vu@@ appears as a separate entry from akp_vu in your host's viewroot directory. When in the context of a special view-tag, version-selection is suppressed completely. To access a particular version of any file or directory element, you must specify the version explicitly. These special entries are periodically deleted on a least-recently-used basis.

UNIX ONLY-EXITING FROM VOB-EXTENDED NAMESPACE. To exit VOB-extended namespace, change to a standard full pathname or a view-extended pathname. (The pathname can specify a VOB or non-VOB location.) For example:

cd /vobs/proj/src@@/main (enter VOB-extended namespace)
pwd /view/david@@/vobs/proj/main/4/src/main
/view/david@@/vobs/proj/main/4/src/main
cd /vobs/proj (exit VOB-extended namespace)
pwd
/vobs/proj

Repeated use of cd .. does not work as you may expect. You do not exit extended namespace where you entered it; instead, you ascend through all the extended-namespace directories listed by pwd. For example:

cd util.c@@/main/rel2_bugfix

ls
0 1 2 LATEST

% pwd
/view/drp_fix@@/usr/hw/main/1/src/main/2/util.c/main/rel2_bugfix

cd ../../..

pwd
/view/drp_fix@@/usr/hw/main/1/src/main/2

cd ../..

pwd
/view/drp_fix@@/usr/hw/main/1/src

cd ../../../

pwd
/view/drp_fix@@/usr/hw

WINDOWS ONLY-SPECIAL "@@" VIEW-TAGS VISIBLE ON M:. When you activate a view, a subdirectory, view-tag, appears on the M: drive for that view. If you enter version-extended namespace while in that view, a parallel subdirectory, view-tag@@, also appears on M:. For example:

C:\> net use f: \\view\myview
...

C:\> dir M:\
11/15/98 10:24p        <DIR>     myview

C:\> f:
F:\> cd \dev\lib@@
F:\dev\lib@@> dir M:
11/15/98 10:24p        <DIR>     myview
11/15/98 10:24p        <DIR>     myview@@

SEE ALSO

cleartool, query_language, version_selector, wildcards_ccase