next up previous contents
Next: 12.2 Parallel bootstrap compilation Up: 12. Parallel and distributed Previous: 12. Parallel and distributed   Contents


12.1 Pathname protocol encoding

A path encoded by CM's master-slave protocol encoding does not only specify which file a path refers to but also, in some sense, specifies why CM constructed this path in the first place. For example, the encoding a/b/c.cm:d/e.sml represents the file a/b/d/e.sml but also tells us that it was constructed by putting d/e.sml into the context of description file a/b/c.cm. Thus, an encoded path name consists of one or more colon-separated ( :) sections, and each section consists of slash-separated ( /) arcs. To find out what actual file a path refers to, it is necessary to erase all arcs that precede colons.

The first section is special because it also specifies whether the whole path was relative or absolute, or whether it was an anchored path.

Anchored paths
start with a dollar-symbol $. The name of the anchor is the string between this leading dollar-symbol and the first occurence of a slash / within the first section. The remaining arcs of the first section are interpreted relative to the current value of the anchor.
Absolute paths
start either with a percent-sign % or a slash /. The canonical form is the one with the percent-sign: it specifies the volume name between the % and the first slash. In the common case where the volume name is empty (i.e, always on Unix systems), the path starts with /.
Relative paths
are all other paths.

Encoded path names never contain white space. Moreover, the encoding for path arcs, volume names, or anchor names does not contain special characters such as /, $, %, :, \, (, and ). Instead, should white space or special characters occur in the non-encoded name, then they will be encoded using the escape-sequence \ddd where ddd is the decimal value of the respective character's ordinal number (i.e, the result of applying Char.ord).

The so-called current arc is encoded as ., the parent arc uses .. as its representation. It might be that under some operating systems the names . or .. do not actually refer to the current or the parent arc. In such a case, CM will encode the dots in these names using the \ddd method, too.

When issuing progress messages, CM shows path names in a form that is almost the same as the protocol encoding. The only difference is that arcs that precede colon-sign : are enclosed within parentheses to emphasize that they are ``not really there''. The same form is also used by CM.Library.descr.


next up previous contents
Next: 12.2 Parallel bootstrap compilation Up: 12. Parallel and distributed Previous: 12. Parallel and distributed   Contents
Matthias Blume
2001-07-19