Brief Index      Full Index      Events Index      I.M. Reference

Show_Pathname_Expansion

Functions

void Show_Pathname_Expansion (const char *pathname, char *expansion)

Function Documentation

void Show_Pathname_Expansion ( const char *  pathname,
char *  expansion 
)

Identifies the full absolute pathname corresponding to a relative pathname.

Parameters:
pathname- A relative pathname with no wildcards.
expansion- The absolute segment name corresponding to pathname. Passed by reference always. Returned to user.

DETAILS

Translates a relative pathname to its absolute pathname in the context of the currently open segment. For example, if the currently open segment is "?picture/a one/and a two", the relative pathname "^/and a three" translates to "?picture/a one/and a three".

As a shortcut to determine the currently open segment, use "." as pathname. (An "open segment search" also can find the currently open segment, but it's more work.)

This routine is most often used when you want to "put your thumb" on a spot in the segment tree---since the expanded name includes the complete specification, you can come back later without worrying about the currently open segment, changes in alias names, etc.

NOTES

This routine takes a simple or partially qualified segment name, and returns a fully qualified name. Show_Segment() , for comparison, takes a key and returns the fully qualified name.

Pathname is expanded whether or not the referenced segments exist at the time of the call, i.e. in the above example, the segment "and a three" need not exist. Use Find_Segment ( Begin_Segment_Search() ) to see if a segment exists.

Any aliases in pathname are replaced by their definitions such that expansion contains no explicit aliases. Use Show_Alias() to see the actual definition of an alias.

Wildcards in a pathname ("*", "%") and anything inside parentheses are returned "as is".

RESTRICTIONS

The Show_Pathname_Expansion routine works fine for simple input segment names, but complicated input path names can confuse it.

See also:
Begin_Segment_Search, Begin_Contents_Search, Begin_Open_Segment_Search, Show_Owner, Show_Segment, Show_Alias.

Brief Index      Full Index      Events Index      I.M. Reference